Rename project to bromine

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/24/head
trivernis 3 years ago
parent 829b1276f1
commit b96119429e
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

26
Cargo.lock generated

@ -8,6 +8,19 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "bromine"
version = "0.5.0"
dependencies = [
"lazy_static",
"log",
"rmp-serde",
"serde",
"thiserror",
"tokio",
"typemap_rev",
]
[[package]]
name = "byteorder"
version = "1.4.3"
@ -146,19 +159,6 @@ dependencies = [
"num-traits",
]
[[package]]
name = "rmp-ipc"
version = "0.5.0"
dependencies = [
"lazy_static",
"log",
"rmp-serde",
"serde",
"thiserror",
"tokio",
"typemap_rev",
]
[[package]]
name = "rmp-serde"
version = "0.15.5"

@ -1,12 +1,12 @@
[package]
name = "rmp-ipc"
name = "bromine"
version = "0.5.0"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/Trivernis/rmp-ipc"
description = "IPC using Rust MessagePack (rmp)"
repository = "https://github.com/Trivernis/bromine/"
description = "A flexible ipc protocol (previously rmp-ipc)"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -1,12 +1,18 @@
# rmp-ipc
<h1 align="center">
bromine
</h1>
<p align="center">
Asynchronous event driven interprocess communication supporting tcp and unix domain sockets.
</p>
Interprocess Communication via TCP using Rust MessagePack.
- - -
## Usage
**Client:**
```rust
use rmp_ipc::{callback, Event, context::Context, IPCBuilder, error::Result};
use bromine::{callback, Event, context::Context, IPCBuilder, error::Result};
/// Callback ping function
async fn handle_ping(ctx: &Context, event: Event) -> Result<()> {
@ -30,8 +36,9 @@ async fn main() {
```
**Server:**
```rust
use rmp_ipc::{IPCBuilder, callback};
use bromine::{IPCBuilder, callback};
// create the server
#[tokio::main]
@ -50,8 +57,9 @@ async fn main() {
### Namespaces
**Client:**
```rust
use rmp_ipc::IPCBuilder;
use bromine::IPCBuilder;
// create the client
#[tokio::main]
@ -75,25 +83,26 @@ async fn main() {
```
**Server:**
```rust
use rmp_ipc::{IPCBuilder, EventHandler, namespace, command, Event, context::Context};
use bromine::{IPCBuilder, EventHandler, namespace, command, Event, context::Context};
// create the server
pub struct MyNamespace;
impl MyNamespace {
async fn ping(_ctx: &Context, _event: Event) -> Result<()> {
println!("My namespace received a ping");
Ok(())
}
async fn ping(_ctx: &Context, _event: Event) -> Result<()> {
println!("My namespace received a ping");
Ok(())
}
}
impl NamespaceProvider for MyNamespace {
fn name() -> String {String::from("my_namespace")}
fn register(handler: &mut EventHandler) {
handler.on("ping", callback!(Self::ping))
}
fn name() -> String { String::from("my_namespace") }
fn register(handler: &mut EventHandler) {
handler.on("ping", callback!(Self::ping))
}
}
#[tokio::main]

@ -15,7 +15,7 @@ use typemap_rev::{TypeMap, TypeMapKey};
/// A builder for the IPC server or client.
/// ```no_run
///use typemap_rev::TypeMapKey;
/// use rmp_ipc::IPCBuilder;
/// use bromine::IPCBuilder;
///
/// struct CustomKey;
///

@ -11,7 +11,7 @@ use typemap_rev::TypeMap;
/// An object provided to each callback function.
/// Currently it only holds the event emitter to emit response events in event callbacks.
/// ```rust
/// use rmp_ipc::prelude::*;
/// use bromine::prelude::*;
///
/// async fn my_callback(ctx: &Context, _event: Event) -> IPCResult<()> {
/// // use the emitter on the context object to emit events

@ -2,7 +2,7 @@
//! messagepack. All calls are asynchronous and event based.
//! Client Example:
//! ```no_run
//! use rmp_ipc::prelude::*;
//! use bromine::prelude::*;
//!
//! /// Callback ping function
//! async fn handle_ping(ctx: &Context, event: Event) -> IPCResult<()> {
@ -56,8 +56,8 @@
//! Server Example:
//! ```no_run
//! use typemap_rev::TypeMapKey;
//! use rmp_ipc::IPCBuilder;
//! use rmp_ipc::callback;
//! use bromine::IPCBuilder;
//! use bromine::callback;
//!
//! struct MyKey;
//!

Loading…
Cancel
Save