Merge branch 'async' into no-mod

This commit is contained in:
Tim Kuehn
2016-01-31 21:21:50 -08:00
2 changed files with 4 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
## tarpc
## tarpc: Tim & Adam's RPC lib
*Disclaimer*: This is not an official Google product.
tarpc is an RPC framework for rust with a focus on ease of use. Defining and implementing an echo-like server can be done in just a few lines of code:
@@ -47,7 +48,7 @@ directly. See the tarpc_examples package for more sophisticated examples.
## Planned Improvements (actively being worked on)
- Automatically reconnect on the client side when the connection cuts out.
- Allow omitting the return type in rpc definitions when the type is `()`.
- Support arbitrary serialization (currently `bincode` is used for all serialization).
- Add backward-compatibility features to enable evolving APIs.
- Support asynchronous server implementations (currently thread per connection).
## Contributing

View File

@@ -145,6 +145,7 @@ impl<'a, S> ConnectionHandler<'a, S> where S: Serve {
loop {
match bincode::serde::deserialize_from(read_stream, bincode::SizeLimit::Infinite) {
Ok(Packet { rpc_id, message, }) => {
debug!("ConnectionHandler: serving request, id: {}, message: {:?}", rpc_id, message);
inflight_rpcs.increment();
scope.execute(move || {
let reply = server.serve(message);
@@ -174,9 +175,6 @@ impl<'a, S> ConnectionHandler<'a, S> where S: Serve {
Err(bincode::serde::DeserializeError::IoError(ref err))
if Self::timed_out(err.kind()) => {
if !shutdown.load(Ordering::SeqCst) {
info!("ConnectionHandler: read timed out ({:?}). Server not \
shutdown, so retrying read.",
err);
continue;
} else {
info!("ConnectionHandler: read timed out ({:?}). Server shutdown, so \