pubsub-server-0.1.3 is not a library.
pubsub-server
Standalone pub/sub message broker binary.
Run it as a long-lived process; any number of clients connect to it over TCP using the pubsub client library.
Install
Run
# Default: binds to 127.0.0.1:4222
# Listen on all interfaces
# With logging
RUST_LOG=info
CLI reference
Usage: pubsub-server [OPTIONS]
Options:
-b, --bind <ADDR> Address to bind the listener to [default: 127.0.0.1:4222]
--max-connections <N> Maximum number of concurrent connections [default: 1024]
--channel-buffer <N> Per-session message channel buffer size [default: 256]
--max-frame-size <BYTES> Maximum wire frame size in bytes [default: 65536]
-h, --help Print help
-V, --version Print version
Connecting clients
[]
= "0.1"
use ;
let client = connect.await?;
client.publish.await?;
Signals
The server handles SIGINT (Ctrl+C) and SIGTERM gracefully. Active sessions are given a short drain period before the process exits.
Logging
Log level is controlled via the RUST_LOG environment variable:
RUST_LOG=debug RUST_LOG=warn
License
MIT or Apache-2.0