Metadata Broker  0.23.2
Typedefs | Functions
subscriber.h File Reference
#include "mdb/connection.h"
#include "mdb/error.h"
#include "mdb/signatures.h"
#include "mdb/subscriber_config.h"
Include dependency graph for subscriber.h:

Go to the source code of this file.

Typedefs

typedef struct mdb_subscriber mdb_subscriber_t
 

Functions

mdb_subscriber_tmdb_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)
 

Detailed Description

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 Documentation

◆ mdb_subscriber_t

typedef struct mdb_subscriber mdb_subscriber_t

The subscriber type represents a subscriber.

Function Documentation

◆ mdb_subscriber_create_async()

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.

Parameters
connectionConnection.
configSubscriber configuration.
on_doneCallback triggering when subscribed to the channel or on error.
user_dataPassed to the on_done callback.
errorAn 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().
Returns
Subscriber on success, NULL on failure.
Examples
consumer/main.c.

◆ mdb_subscriber_destroy()

void mdb_subscriber_destroy ( mdb_subscriber_t **  self)

Destroy given subscriber.

Also ends any active subscription.

Parameters
selfSubscriber to destroy or NULL. If subscriber is NULL this function will do nothing. *self will be set to NULL after this call.
Examples
consumer/main.c.