Prepare v0.25 release

This commit is contained in:
Tim Kuehn
2021-03-10 19:49:30 -08:00
parent 75a5591158
commit 1da6bcec57
6 changed files with 81 additions and 10 deletions

View File

@@ -59,7 +59,7 @@ Some other features of tarpc:
Add to your `Cargo.toml` dependencies:
```toml
tarpc = "0.24"
tarpc = "0.25"
```
The `tarpc::service` attribute expands to a collection of items that form an rpc service.
@@ -73,7 +73,7 @@ your `Cargo.toml`:
```toml
futures = "1.0"
tarpc = { version = "0.24", features = ["tokio1"] }
tarpc = { version = "0.25", features = ["tokio1"] }
tokio = { version = "1.0", features = ["macros"] }
```
@@ -126,7 +126,7 @@ impl World for HelloServer {
```
Lastly let's write our `main` that will start the server. While this example uses an
[in-process channel](rpc::transport::channel), tarpc also ships a generic [`serde_transport`]
[in-process channel](transport::channel), tarpc also ships a generic [`serde_transport`]
behind the `serde-transport` feature, with additional [TCP](serde_transport::tcp) functionality
available behind the `tcp` feature.

View File

@@ -1,3 +1,74 @@
## 0.25.0 (2021-03-10)
### Breaking Changes
#### Major server module refactoring
1. Renames
Some of the items in this module were renamed to be less generic:
- Handler => Incoming
- ClientHandler => Requests
- ResponseHandler => InFlightRequest
- Channel::{respond_with => requests}
In the case of Handler: handler of *what*? Now it's a bit clearer that this is a stream of Channels
(aka *incoming* connections).
Similarly, ClientHandler was a stream of requests over a single connection. Hopefully Requests
better reflects that.
ResponseHandler was renamed InFlightRequest because it no longer contains the serving function.
Instead, it is just the request, plus the response channel and an abort hook. As a result of this,
Channel::respond_with underwent a big change: it used to take the serving function and return a
ClientHandler; now it has been renamed Channel::requests and does not take any args.
2. Execute methods
All methods thats actually result in responses being generated have been consolidated into methods
named `execute`:
- InFlightRequest::execute returns a future that completes when a response has been generated and
sent to the server Channel.
- Requests::execute automatically spawns response handlers for all requests over a single channel.
- Channel::execute is a convenience for `channel.requests().execute()`.
- Incoming::execute automatically spawns response handlers for all requests over all channels.
3. Removal of Server.
server::Server was removed, as it provided no value over the Incoming/Channel abstractions.
Additionally, server::new was removed, since it just returned a Server.
#### Client RPC methods now take &self
This required the breaking change of removing the Client trait. The intent of the Client trait was
to facilitate the decorator pattern by allowing users to create their own Clients that added
behavior on top of the base client. Unfortunately, this trait had become a maintenance burden,
consistently causing issues with lifetimes and the lack of generic associated types. Specifically,
it meant that Client impls could not use async fns, which is no longer tenable today, with channel
libraries moving to async fns.
#### Servers no longer send deadline-exceed responses.
The deadline-exceeded response was largely redundant, because the client
shouldn't normally be waiting for such a response, anyway -- the normal
client will automatically remove the in-flight request when it reaches
the deadline.
This also allows for internalizing the expiration+cleanup logic entirely
within BaseChannel, without having it leak into the Channel trait and
requiring action taken by the Requests struct.
#### Clients no longer send cancel messages when the request deadline is exceeded.
The server already knows when the request deadline was exceeded, so the client didn't need to inform
it.
### Fixes
- When a channel is dropped, all in-flight requests for that channel are now aborted.
## 0.24.1 (2020-12-28)
### Breaking Changes

View File

@@ -1,6 +1,6 @@
[package]
name = "tarpc-example-service"
version = "0.8.0"
version = "0.9.0"
authors = ["Tim Kuehn <tikue@google.com>"]
edition = "2018"
license = "MIT"
@@ -17,7 +17,7 @@ clap = "2.33"
env_logger = "0.8"
futures = "0.3"
serde = { version = "1.0" }
tarpc = { version = "0.24", path = "../tarpc", features = ["full"] }
tarpc = { version = "0.25", path = "../tarpc", features = ["full"] }
tokio = { version = "1", features = ["full"] }
[lib]

View File

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

View File

@@ -1,6 +1,6 @@
[package]
name = "tarpc"
version = "0.24.1"
version = "0.25.1"
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
edition = "2018"
license = "MIT"
@@ -35,7 +35,7 @@ pin-project = "1.0"
rand = "0.7"
serde = { optional = true, version = "1.0", features = ["derive"] }
static_assertions = "1.1.0"
tarpc-plugins = { path = "../plugins", version = "0.9" }
tarpc-plugins = { path = "../plugins", version = "0.10" }
tokio = { version = "1", features = ["time"] }
tokio-util = { version = "0.6.3", features = ["time"] }
tokio-serde = { optional = true, version = "0.8" }

View File

@@ -46,7 +46,7 @@
//! Add to your `Cargo.toml` dependencies:
//!
//! ```toml
//! tarpc = "0.24"
//! tarpc = "0.25"
//! ```
//!
//! The `tarpc::service` attribute expands to a collection of items that form an rpc service.
@@ -60,7 +60,7 @@
//!
//! ```toml
//! futures = "1.0"
//! tarpc = { version = "0.24", features = ["tokio1"] }
//! tarpc = { version = "0.25", features = ["tokio1"] }
//! tokio = { version = "1.0", features = ["macros"] }
//! ```
//!