chore(examples): Remove dummy echo implementation (#1178)

This commit is contained in:
tottoto
2022-12-05 12:08:41 -05:00
committed by GitHub
parent 1efabf0003
commit df8dd896da
18 changed files with 61 additions and 246 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ pub mod hello_world {
}
pub mod echo {
tonic::include_proto!("grpc.examples.echo");
tonic::include_proto!("grpc.examples.unaryecho");
}
use echo::{echo_client::EchoClient, EchoRequest};
+1 -30
View File
@@ -1,5 +1,3 @@
use futures::Stream;
use std::pin::Pin;
use tonic::{transport::Server, Request, Response, Status};
pub mod hello_world {
@@ -7,7 +5,7 @@ pub mod hello_world {
}
pub mod echo {
tonic::include_proto!("grpc.examples.echo");
tonic::include_proto!("grpc.examples.unaryecho");
}
use hello_world::{
@@ -20,8 +18,6 @@ use echo::{
EchoRequest, EchoResponse,
};
type ResponseStream = Pin<Box<dyn Stream<Item = Result<EchoResponse, Status>> + Send>>;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "[::1]:50051".parse().unwrap();
@@ -66,29 +62,4 @@ impl Echo for MyEcho {
let message = request.into_inner().message;
Ok(Response::new(EchoResponse { message }))
}
type ServerStreamingEchoStream = ResponseStream;
async fn server_streaming_echo(
&self,
_: Request<EchoRequest>,
) -> Result<Response<Self::ServerStreamingEchoStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn client_streaming_echo(
&self,
_: Request<tonic::Streaming<EchoRequest>>,
) -> Result<Response<EchoResponse>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
type BidirectionalStreamingEchoStream = ResponseStream;
async fn bidirectional_streaming_echo(
&self,
_: Request<tonic::Streaming<EchoRequest>>,
) -> Result<Response<Self::BidirectionalStreamingEchoStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
}