A flexible ipc rust library supporting several protocols
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.
Go to file
trivernis 8e483b97cb
Add event_ids to events
Signed-off-by: trivernis <trivernis@protonmail.com>
3 years ago
.github/workflows Add GITHUB ACTIONS 3 years ago
src Add event_ids to events 3 years ago
.gitignore Add most ipc stuff 3 years ago
Cargo.toml Add event_ids to events 3 years ago
LICENSE Add README, LICENSE and metadata for crates.io 3 years ago
README.md rename Message Pack to MessagePack 3 years ago

README.md

rmp-ipc

Interprocess Communication via TCP using Rust MessagePack.

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