mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-08 20:42:42 +01:00
Merge master into async
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:
|
||||
|
||||
@@ -42,7 +43,7 @@ The `rpc!` macro generates a module in the current module. In the above example,
|
||||
## 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
|
||||
|
||||
@@ -155,6 +155,7 @@ impl<'a, S> ConnectionHandler<'a, S> where S: Serve {
|
||||
loop {
|
||||
match Self::read(read_stream, timeout) {
|
||||
Ok(Packet { rpc_id, message, }) => {
|
||||
debug!("ConnectionHandler: serving request, id: {}, message: {:?}", rpc_id, message);
|
||||
inflight_rpcs.increment();
|
||||
scope.spawn(move || {
|
||||
let reply = server.serve(message);
|
||||
@@ -180,9 +181,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