Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 2.14 KB

README.md

File metadata and controls

56 lines (36 loc) · 2.14 KB

zzrpc

Test Status Crate API

RPC over mezzenger transports.

https://crates.io/crates/zzrpc

ko-fi

usage

See zzrpc-tutorial.

targeting WebAssembly

See rust-webapp-template-api.

further work

Following improvements are planned for development:

  1. 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>;
  1. An option to generate bindings so consumer methods could be called directly from JavaScript using wasm-bindgen.

see also

mezzenger

remote procedure call