#include <messaging.h>
Public Attributes | |
Connection *(* | open_connection )(void) |
Channel *(* | open_channel )(Connection *connection, const char *channel_name) |
void(* | close_connection )(Connection *connection) |
void(* | close_channel )(Channel *channel) |
void(* | send )(Channel *channel, Message *message) |
void(* | unsubscribe )(Channel *channel) |
void(* | subscribe )(Channel *channel, callback fp, void *state) |
Messaging_Controller *(* | get_controller )() |
A Messaging instance encapsulates the common messaging-related functions an application component may need to use, such as suscribing to channels, sending messages, registering a callback upon message receipt, etc.
void(* messaging::close_channel)(Channel *channel) |
Close a channel. Any subscriptions will be cancelled.
channel | The specific channel to close. |
void(* messaging::close_connection)(Connection *connection) |
Close a connection. Any open channels will be closed as well.
connection | The Connection to close. |
Get the Messaging_Controller instance for the given Messaging implementation.
It is typically not necessary for application components themselves to need access to the controller functions. Use with caution.
Channel*(* messaging::open_channel)(Connection *connection, const char *channel_name) |
Open a named channel from a connection.
connection | Connection from which to create this channnel | |
channel_name | Name/label for the channel. |
Connection*(* messaging::open_connection)(void) |
Open a new connection.
void(* messaging::send)(Channel *channel, Message *message) |
Send a message on the given channel.
channel | The channel on to which to send the message. | |
message | The message content to send. |
void(* messaging::subscribe)(Channel *channel, callback fp, void *state) |
Subscribe to messages on the given channel. Messages will be delivered to callback when ready
void(* messaging::unsubscribe)(Channel *channel) |
Cancel a subscription on the given channel.