struct CnSubscriber CnSubscriber
The subscriber.
Definition broker.h:142
CnLoad * cn_subscriber_await(CnSubscriber *sber)
Wait for the messages that are wanted by the subscriber.
void cn_subscribe(CnSubscriber *sber, const char *topic)
Subscribe to a topic.
CnChannel * cn_broker_search(CnBroker *broker, const char *topic)
Find the channel that is assigned to the given topic.
void cn_subscriber_unload(CnSubscriber *sber)
Inform the broker that the message can be released for the given subscriber.
void cn_broker_destroy(CnBroker *broker)
Destroy the message broker.
CnBroker * cn_broker_create(const struct CnLoadVt *vp)
Create the message broker.
const char * cn_channel_gettopic(const CnChannel *ch)
Get the topic for the given channel.
void cn_subscriber_destroy(CnSubscriber *sber)
Destroy the subscriber.
CnChannel * cn_load_getchan(const CnLoad *load)
Get the source channel of the message.
struct CnBroker CnBroker
The message broker.
Definition broker.h:135
struct CnChannel CnChannel
The channel for messages.
Definition broker.h:153
CnLoad * cn_subscriber_poll(CnSubscriber *sber)
Poll for the messages that are wanted by the subscriber.
char CnLoad
Opaque data type that represents the message load.
Definition broker.h:80
void cn_publish(CnChannel *ch,...)
Broadcast the message.
CnSubscriber * cn_subscriber_create(CnBroker *broker)
Create the subscriber.
Vtable for message construction.
Definition broker.h:87
size_t(* size)(void)
Callback for obtaining the size of the load.
Definition broker.h:98
void(* ctor)(CnLoad *, va_list)
Constructor callback for the message.
Definition broker.h:113
void(* dtor)(CnLoad *)
Destructor callback for the message.
Definition broker.h:122