#include <pubsub.h>
|
| | PubSub () |
| |
| | PubSub (Config config) |
| |
| | ~PubSub () override |
| |
| void | subscribe (const std::string &topic, Handler handler) |
| | Subscribe to a topic and deliver matching messages to handler.
|
| |
| void | unsubscribe (const std::string &topic) |
| |
| void | publish (const std::string &topic, ByteView data) |
| | Publish data on topic: along the mesh if we are subscribed, else via fanout.
|
| |
| bool | is_subscribed (const std::string &topic) const |
| |
| std::vector< std::string > | subscribed_topics () const |
| |
| std::vector< PeerId > | peers_for_topic (const std::string &topic) const |
| | known subscribers
|
| |
| std::vector< PeerId > | mesh_peers (const std::string &topic) const |
| | our mesh for topic
|
| |
| void | set_validator (const std::string &topic, Validator validator) |
| | Gate inbound messages for a topic; topic == "" installs a global validator used when no per-topic validator is registered.
|
| |
| void | attach (NodeContext &ctx) override |
| |
| void | start () override |
| | launch the heartbeat thread
|
| |
| void | stop () override |
| | stop and join it
|
| |
| virtual | ~Subsystem ()=default |
| |
Definition at line 58 of file pubsub.h.
◆ Handler
◆ Validator
◆ PubSub() [1/2]
| librats::PubSub::PubSub |
( |
| ) |
|
◆ PubSub() [2/2]
| librats::PubSub::PubSub |
( |
Config |
config | ) |
|
|
explicit |
◆ ~PubSub()
| librats::PubSub::~PubSub |
( |
| ) |
|
|
override |
◆ attach()
◆ is_subscribed()
| bool librats::PubSub::is_subscribed |
( |
const std::string & |
topic | ) |
const |
◆ mesh_peers()
| std::vector< PeerId > librats::PubSub::mesh_peers |
( |
const std::string & |
topic | ) |
const |
◆ peers_for_topic()
| std::vector< PeerId > librats::PubSub::peers_for_topic |
( |
const std::string & |
topic | ) |
const |
◆ publish()
| void librats::PubSub::publish |
( |
const std::string & |
topic, |
|
|
ByteView |
data |
|
) |
| |
Publish data on topic: along the mesh if we are subscribed, else via fanout.
◆ set_validator()
| void librats::PubSub::set_validator |
( |
const std::string & |
topic, |
|
|
Validator |
validator |
|
) |
| |
Gate inbound messages for a topic; topic == "" installs a global validator used when no per-topic validator is registered.
◆ start()
| void librats::PubSub::start |
( |
| ) |
|
|
overridevirtual |
◆ stop()
| void librats::PubSub::stop |
( |
| ) |
|
|
overridevirtual |
◆ subscribe()
| void librats::PubSub::subscribe |
( |
const std::string & |
topic, |
|
|
Handler |
handler |
|
) |
| |
Subscribe to a topic and deliver matching messages to handler.
◆ subscribed_topics()
| std::vector< std::string > librats::PubSub::subscribed_topics |
( |
| ) |
const |
◆ unsubscribe()
| void librats::PubSub::unsubscribe |
( |
const std::string & |
topic | ) |
|
The documentation for this class was generated from the following file: