wamp_async

crates.io mioLines of Code

An asynchronous WAMP client implementation written in rust.

Usage

For usage examples, see : - Publisher/Subscriber ```rust match client.publish("peer.heartbeat", None, None, true).await { Ok(pubid) => println!("\tPublish id {:X}", pubid), Err(e) => println!("publish error {}", e), }; //<...> let (subid, mut event_queue) = client.subscribe("peer.heartbeat").await?;

match eventqueue.recv().await { Some((pubid, args, kwargs)) => println!("\tEvent(args: {:?}, kwargs: {:?})", args, kwargs), None => println!("event queue is closed"), }; - [RPC caller](https://gitlab.com/elast0ny/wamp_async-rs/-/blob/master/examples/rpc_caller.rs) rust match client.call("peer.echo", Some(vec![Arg::Integer(12)]), None).await { Ok((resargs, reskwargs)) => println!("\tGot {:?} {:?}", resargs, reskwargs), Err(e) => println!("Error calling ({:?})", e), }; - [RPC callee](https://gitlab.com/elast0ny/wamp_async-rs/-/blob/master/examples/rpc_callee.rs) rust async fn rpcecho(args: WampArgs, kwargs: WampKwArgs) -> Result<(WampArgs, WampKwArgs), WampError> { println!("peer.echo {:?} {:?}", args, kwargs); Ok((args, kwargs)) } //<...> let rpcid = client.register("peer.echo", rpcecho).await?; ```

Features

| Feature | Desciption | Status | |---------|------------|--------| |Websocket| Use websocket as the transport | ✔ | |Secure Websocket| Websocket over HTTPS | ✔ | | RawSocket | Use lightweight TCP as the transport | ✔ | | Secure RawSocket | RawSocket with TLS | ✔ | |MsgPack| Use MessagePack for message serialization | ✔ | |JSON | Uses JSON for message serialization | ✔ |

Client

Basic profile :

| Feature | Desciption | Status | |---------|------------|--------| | Publisher | Ability to publish messages on topics | ✔ | | Subscriber | Can subscribe and receive events for a topic | ✔ | | Caller | Ability to call RPC endpoints | ✔ | | Callee | Ability to register RPC endpoints | ✔ |

Advanced profile:

TODO

License

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.