# PubSub client ## Quick and easy 1. run `sudo docker build -t client .` 2. run `sudo docker run --rm --network=host -it client publish topic message` 2. run `sudo docker run --rm --network=host -it client consume topic` ## With Cargo 1. run `cargo build --release` 2. run `./target/release/client publish topic message` 2. run `./target/release/client consume topic` ## CLI Note that there are a few changes in the CLI interface as opposed to what's in the email. Please see `--help` for details. Examples (binary named client): Publish a message `client publish mytopic mymessage` Consume a message (default timeout of 10s) `client consume mytopic` Consume a message with given timeout (seconds) `client consume mytopic -t 15` ``` $ ./target/release/client --help pubsub-rs 0.1.0 USAGE: client [OPTIONS] OPTIONS: -e, --endpoint [default: localhost] -h, --help Print help information -p, --port [default: 50051] --protocol [default: tcp] [possible values: http, tcp] -V, --version Print version information SUBCOMMANDS: consume help Print this message or the help of the given subcommand(s) publish ``` Publish: ``` client-publish USAGE: client publish ARGS: OPTIONS: -h, --help Print help information ``` Consume: ``` client-consume USAGE: client consume [OPTIONS] ARGS: OPTIONS: -h, --help Print help information -t, --timeout [default: 10] ```