mirror of https://github.com/Trivernis/bromine.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trivernis
e088680f68
Signed-off-by: trivernis <trivernis@protonmail.com> |
4 years ago | |
---|---|---|
src | 4 years ago | |
.gitignore | 4 years ago | |
Cargo.toml | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago |
README.md
rmp-ipc
Interprocess Communication via TCP using Rust Message Pack.
Usage
Client:
use rmp_ipc::IPCBuilder;
// create the client
let emitter = IPCBuilder::new()
.address("127.0.0.1:2020")
// register callback
.on("ping", |_ctx, _event| Box::pin(async move {
println!("Received ping event.");
Ok(())
}))
.build_client().await.unwrap();
// emit an initial event
emitter.emit("ping", ()).await?;
Server:
use rmp_ipc::IPCBuilder;
// create the server
IPCBuilder::new()
.address("127.0.0.1:2020")
// register callback
.on("ping", |_ctx, _event| Box::pin(async move {
println!("Received ping event.");
Ok(())
}))
.build_server().await.unwrap();
License
Apache-2.0