Update interop server
This commit is contained in:
@@ -3,12 +3,12 @@ mod data;
|
||||
use futures::{Stream, StreamExt};
|
||||
use std::collections::HashMap;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use tokio::sync::{mpsc, Lock};
|
||||
use tonic::transport::Server;
|
||||
use tonic::{Request, Response, Status};
|
||||
use std::pin::Pin;
|
||||
|
||||
pub mod routeguide {
|
||||
include!(concat!(env!("OUT_DIR"), "/routeguide.rs"));
|
||||
@@ -147,7 +147,10 @@ impl routeguide::RouteGuide for RouteGuide {
|
||||
};
|
||||
|
||||
// TODO: Clean this up
|
||||
Ok(Response::new(Box::pin(output) as Pin<Box<dyn Stream<Item = Result<RouteNote, Status>> + Send + 'static>>))
|
||||
Ok(Response::new(Box::pin(output)
|
||||
as Pin<
|
||||
Box<dyn Stream<Item = Result<RouteNote, Status>> + Send + 'static>,
|
||||
>))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,9 +170,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
let svc = routeguide::RouteGuideServer::new(route_guide);
|
||||
|
||||
Server::builder()
|
||||
.serve(addr, svc)
|
||||
.await?;
|
||||
Server::builder().serve(addr, svc).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user