Update interop server

This commit is contained in:
Lucio Franco
2019-09-06 15:37:08 -04:00
parent d0cfafafc6
commit ec5778dfa1
6 changed files with 51 additions and 22 deletions
+6 -5
View File
@@ -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(())
}