mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-07 03:56:48 +01:00
Finish the multiplex implementation
This commit is contained in:
@@ -13,13 +13,13 @@ use serde::{Deserialize, Serialize};
|
||||
use std::io;
|
||||
use std::net::SocketAddr;
|
||||
use tokio_core::reactor::Handle;
|
||||
use tokio_proto::pipeline;
|
||||
use tokio_proto::{self as proto, multiplex};
|
||||
use tokio_proto::server::{self, ServerHandle};
|
||||
use tokio_service::NewService;
|
||||
use util::Never;
|
||||
|
||||
/// A message from server to client.
|
||||
pub type Response<T, E> = pipeline::Message<Result<T, WireError<E>>, Empty<Never, io::Error>>;
|
||||
pub type Response<T, E> = proto::Message<Result<T, WireError<E>>, Empty<Never, io::Error>>;
|
||||
|
||||
/// Spawns a service that binds to the given address and runs on the default reactor core.
|
||||
pub fn listen<S, Req, Resp, E>(addr: SocketAddr, new_service: S) -> ListenFuture
|
||||
@@ -48,7 +48,7 @@ pub fn listen_with<S, Req, Resp, E>(addr: SocketAddr, new_service: S, handle: &H
|
||||
E: Serialize,
|
||||
{
|
||||
server::listen(handle, addr, move |stream| {
|
||||
pipeline::Server::new(new_service.new_service()?, Framed::new(stream))
|
||||
Ok(multiplex::Server::new(new_service.new_service()?, Framed::new(stream)))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user