Metadata Broker
0.23.2
|
#include "mdb/connection.h"
#include "mdb/error.h"
#include "mdb/signatures.h"
#include "mdb/subscriber_config.h"
Go to the source code of this file.
Typedefs | |
typedef struct mdb_subscriber | mdb_subscriber_t |
Functions | |
mdb_subscriber_t * | mdb_subscriber_create_async (mdb_connection_t *connection, mdb_subscriber_config_t *config, mdb_on_done_t on_done, void *user_data, mdb_error_t **error) |
void | mdb_subscriber_destroy (mdb_subscriber_t **self) |
Copyright Axis Communications AB
This is the subscriber header for the Metadata Broker client library. It implements functionality for subscribing to metadata published on a channel.
In order to subscribe to a channel a subscriber must be created. The channel is identified by a source and is grouped under a topic. The unix user using the API must have permission to subscribe to metadata from channel(s) under a specific topic.
typedef struct mdb_subscriber mdb_subscriber_t |
The subscriber type represents a subscriber.
mdb_subscriber_t* mdb_subscriber_create_async | ( | mdb_connection_t * | connection, |
mdb_subscriber_config_t * | config, | ||
mdb_on_done_t | on_done, | ||
void * | user_data, | ||
mdb_error_t ** | error | ||
) |
Create a subscriber for a specific channel
It is possible to create a subscriber before the corresponding channel is registered.
Creating a subscriber will signal the producer to start publishing on the channel, if it has not already been signaled to start by another subscriber. Don't create a subscriber until you intend to use the published data since it may consume producer resources.
If the channel is unregistered and then re-registered will not affect the subscriber other than the fact that metadata will no longer be received in the on_metadata callback.
connection | Connection. |
config | Subscriber configuration. |
on_done | Callback triggering when subscribed to the channel or on error. |
user_data | Passed to the on_done callback. |
error | An mdb_error_t pointer reference or NULL. An mdb_error_t will be allocated on failure and must then be destroyed with mdb_destroy_error(). |
void mdb_subscriber_destroy | ( | mdb_subscriber_t ** | self | ) |
Destroy given subscriber.
Also ends any active subscription.
self | Subscriber to destroy or NULL. If subscriber is NULL this function will do nothing. *self will be set to NULL after this call. |