v0.22.0
[v0.22.0] - 2024-02-07
Another breaking release where a new ResponsePayload
type is introduced in order
to make it possible to determine whether a response has been processed.
Unfortunately, the IntoResponse trait
was modified to enable that
and some minor changes were made to make more fields private to avoid further
breakage.
Example of the async ResponsePayload API
#[rpc(server)]
pub trait Api {
#[method(name = "x")]
fn x(&self) -> ResponsePayload<'static, String>;
}
impl RpcServer for () {
fn x(&self) -> ResponsePayload<'static, String> {
let (rp, rp_done) = ResponsePayload::success("ehheeheh".to_string()).notify_on_completion();
tokio::spawn(async move {
if rp_done.await.is_ok() {
do_task_that_depend_x();
}
});
rp
}
}
Roadmap
We are getting closer to releasing jsonrpsee v1.0 and
the following work is planned:
- Native async traits
- Upgrade hyper to v1.0
- Better subscription API for the client.
Thanks to the external contributor @dan-starkware who contributed to this release.
[Added]
- feat(server): add
TowerService::on_session_close
(#1284) - feat(server): async API when
Response
has been processed. (#1281)