Skip to content

v0.22.0

Compare
Choose a tag to compare
@niklasad1 niklasad1 released this 07 Feb 15:43
· 100 commits to master since this release
v0.22.0
72939a9

[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)

[Changed]

  • client(error): make display impl less verbose (#1283)
  • fix: allow application/json-rpc http content type (#1277)
  • refactor(rpc_module): RpcModule::raw_json_request -> String (#1287)