#include <IPubsub.h>
Interface for Pub/Sub client backends.
Definition at line 14 of file IPubsub.h.
◆ SubscriptionId
Subscription ID which is unique for each single subscription.
Definition at line 22 of file IPubsub.h.
◆ ~IPubsub()
virtual zserio::IPubsub::~IPubsub |
( |
| ) |
|
|
virtualdefault |
◆ publish()
virtual void zserio::IPubsub::publish |
( |
std::string_view |
topic, |
|
|
Span< const uint8_t > |
data, |
|
|
void * |
context |
|
) |
| |
|
pure virtual |
Publishes given data as a specified topic.
- Parameters
-
topic | Topic definition. |
data | Data to publish. |
context | Context specific for a particular Pub/Sub implementation. |
- Exceptions
-
◆ subscribe()
virtual SubscriptionId zserio::IPubsub::subscribe |
( |
std::string_view |
topic, |
|
|
const std::shared_ptr< OnTopicCallback > & |
callback, |
|
|
void * |
context |
|
) |
| |
|
pure virtual |
Subscribes a topic.
- Parameters
-
topic | Topic definition to subscribe. Note that the definition format depends on the particular Pub/Sub backend implementation and therefore e.g. wildcards can be used only if they are supported by Pub/Sub backend. |
callback | Callback to be called when a message with the specified topic arrives. |
context | Context specific for a particular Pub/Sub implementation. |
- Returns
- Subscription ID.
- Exceptions
-
◆ unsubscribe()
Unsubscribes the subscription with the given ID.
- Parameters
-
id | ID of the subscription to be unsubscribed. |
- Exceptions
-
The documentation for this class was generated from the following file: