Skip to content
/ tzpipe Public

tzpipe is a commandline utility for communicating with a minibus server.

License

Notifications You must be signed in to change notification settings

ttyzero/tzpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tzpipe utility for minibus message handling from the shell

tzpipe is a command line utility that lets you send and receive messages to and from a minibus service.

USAGE

tzpipe [send|listen] channel arg1 arg2..

Listening:

tzpipe always needs a verb (send | listen) and a minibus channel name to operate on, with no other parameters this listens on the selected channel and outputs to STDOUT.

Here we connect to a ficticious channel that is being sent random animals:

> tzpipe listen animals
cats
dogs
rabbits
...

We can give tzpipe a regular expression (using Golang's regex syntax)

> tzpipe listen animals --filter='^dogs'
dogs
dogs
dogs 
...

While this is interesting, sometimes you may want to wait for a particular message and then act on it in a script, you can do this by using the --limit argument which will exit tzpipe after a given number of messages:

l=$(tzpipe listen animals --filter='llama' --limit=1)
echo "Found a $l!"

Sending

tzpipe allows you to send messages to channels as well, there are a number of ways to do this:

> tzpipe send foo 'This is a message'

tzpipe accepts STDIN and will send each line to the channel, you can use --limit here as well to stop capturing after a number of lines:

cat /dev/poetry | tzpipe send foo --limit=100

You can use tzpipe to reduce incomming messages and deliver them to a different channel, here we filter cats from the animals channel, log matches to STDERR and send them on to the 'catsonly' channel:

tzpipe listen animals --filter='^cats' --log | tzpipe send catsonly



ttyZero Logo

tzpipe is part of the ttyZero Project

tzpipe is (c) 2018 ttyZero authors
and is available under the MIT license.

About

tzpipe is a commandline utility for communicating with a minibus server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages