Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Caryatid multi-channel subscription example

This example is the simplest possible multi-subscription model. There are three modules, Publisher1, Publisher2 and a Subscriber. The publishers publish messages on the topics sample1.test and sample2.test and the subscriber subscribes to sample1.# and sample2.#. The messages are JSON objects.

How to run it

$ cd examples/multi
$ cargo run

Points of interest

In the the subscriber you can see how you can subscribe to multiple channels using the pull interface. Note that reading from the subscriptions is blocking and async, so assigning the futures to variables at the top of the reading loop and then awaiting them as necessary will keep blocking time to a minimum.