mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-06 19:45:25 +01:00
Merge branch 'async' into no-mod
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user