zzrpc
RPC over mezzenger transports.
https://crates.io/crates/zzrpc
usage
See zzrpc-tutorial.
targeting WebAssembly
further work
Following improvements are planned for development:
- Support for two more method types:
-
method with default return without acknowledgment - its future will return as soon as request message is sent to producer without waiting for
()
response from the producer:#[no-ack] async fn do_something_i_dont_care_if_it_completes(&self, some_argument: i32);
-
method with
CancellationToken
argument - so producer implementors can receive request abort messages (currently "aborting" a request means only that the producer will ignore task's result and not send it to the consumer - it doesn't mean the task itself is meaningfully affected):use tokio_util::sync::CancellationToken; // ... async fn do_some_task( &self, cancellation_token: CancellationToken, some_argument: i32) -> u64;
Of course consumer method would not have
cancellation_token
argument:fn do_some_task(&self, some_argument: i32) -> zzrpc::ValueRequest<u64, Request, Self::Error>;
- An option to generate bindings so consumer methods could be called directly from JavaScript using wasm-bindgen.