Prepare v0.21.1

This commit is contained in:
Tim Kuehn
2020-08-02 21:05:54 -07:00
parent f65dd05949
commit e3f34917c5
4 changed files with 56 additions and 5 deletions

View File

@@ -1,3 +1,52 @@
## 0.21.1 (2020-08-02)
### New Features
#### #[tarpc::server] diagnostics
When a service impl uses #[tarpc::server], only `async fn`s are re-written. This can lead to
confusing compiler errors about missing associated types:
```
error: not all trait items implemented, missing: `HelloFut`
--> $DIR/tarpc_server_missing_async.rs:9:1
|
9 | impl World for HelloServer {
| ^^^^
```
The proc macro now provides better diagnostics for this case:
```
error: not all trait items implemented, missing: `HelloFut`
--> $DIR/tarpc_server_missing_async.rs:9:1
|
9 | impl World for HelloServer {
| ^^^^
error: hint: `#[tarpc::server]` only rewrites async fns, and `fn hello` is not async
--> $DIR/tarpc_server_missing_async.rs:10:5
|
10 | fn hello(name: String) -> String {
| ^^
```
### Bug Fixes
#### Fixed client hanging when server shuts down
Previously, clients would ignore when the read half of the transport was closed, continuing to
write requests. This didn't make much sense, because without the ability to receive responses,
clients have no way to know if requests were actually processed by the server. It basically just
led to clients that would hang for a few seconds before shutting down. This has now been
corrected: clients will immediately shut down when the read-half of the transport is closed.
#### More docs.rs documentation
Previously, docs.rs only documented items enabled by default, notably leaving out documentation
for tokio and serde features. This has now been corrected: docs.rs should have documentation
for all optional features.
## 0.21.0 (2020-06-26)
### New Features

View File

@@ -11,6 +11,8 @@ use tokio_serde::formats::Json;
#[tokio::main]
async fn main() -> io::Result<()> {
env_logger::init();
let flags = App::new("Hello Client")
.version("0.1")
.author("Tim <tikue@google.com>")

View File

@@ -1,6 +1,6 @@
[package]
name = "tarpc"
version = "0.21.0"
version = "0.21.1"
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
edition = "2018"
license = "MIT"

View File

@@ -20,7 +20,7 @@ use futures::{
task::*,
};
use humantime::format_rfc3339;
use log::{debug, info, trace};
use log::{debug, trace};
use pin_project::pin_project;
use std::{fmt, hash::Hash, io, marker::PhantomData, pin::Pin, time::SystemTime};
use tokio::time::Timeout;
@@ -664,8 +664,8 @@ where
tokio::spawn(request_handler);
Ok(())
})
.map_ok(|()| info!("ClientHandler finished."))
.unwrap_or_else(|e| info!("ClientHandler errored out: {}", e))
.map_ok(|()| log::info!("ClientHandler finished."))
.unwrap_or_else(|e| log::info!("ClientHandler errored out: {}", e))
}
}
@@ -701,7 +701,7 @@ where
.execute(),
);
}
info!("Server shutting down.");
log::info!("Server shutting down.");
Poll::Ready(())
}
}