Crate cord_client
source ·Expand description
Cord is a data streaming platform for composing, aggregating and distributing arbitrary streams. It uses a publish-subscribe model that allows multiple publishers to share their streams via a Cord Broker. Subscribers can then compose custom sinks using a regex-like pattern to access realtime data based on their individual requirements.
To interact with a Broker, we use this library:
Examples
use cord_client::Client;
let mut conn = Client::connect(("127.0.0.1", 7101)).await?;
// Tell the broker we're going to provide the namespace /users
conn.provide("/users".into()).await?;
// Start publishing events...
conn.event("/users/mark".into(), "Mark has joined").await?;
Cord CLI
For one-off interactions with a Broker, there is also the Cord CLI, which is available via Cargo:
$ cargo install cord-client
$ cord-client sub /namespaces
For more usage, check the usage guidelines on cord-proj.org.
Modules
Structs
- The
ClientConn
manages the connection between you and a Cord Broker. - A
Subscriber
encapsulates a stream of events for a subscribed namespace. It is created byClient::subscribe()
.
Type Definitions
- The
Client
type alias defines theSink
type for communicating with a Broker.