Diffusion C API 6.12.0
Loading...
Searching...
No Matches
Receiving data from topics.

Functions

DIFFUSION_FETCH_REQUEST_Tdiffusion_fetch_request_init (SESSION_T *session)
 Creates an unconfigured fetch request.
 
DIFFUSION_FETCH_REQUEST_Tdiffusion_fetch_request_dup (const DIFFUSION_FETCH_REQUEST_T *fetch_request)
 Create a duplicate (copy) of an existing DIFFUSION_FETCH_REQUEST_T.
 
void diffusion_fetch_request_free (DIFFUSION_FETCH_REQUEST_T *fetch_request)
 Free a memory allocated DIFFUSION_FETCH_REQUEST_T
 
TOPIC_HANDLER_T subscribe (SESSION_T *session, const SUBSCRIPTION_PARAMS_T params)
 Request subscription to topic.
 
TOPIC_HANDLER_T diffusion_subscribe_with_scope (SESSION_T *session, const char *selection_scope, const SUBSCRIPTION_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Request subscription to topics using a scope selection.
 
void unsubscribe (SESSION_T *session, const UNSUBSCRIPTION_PARAMS_T params)
 Unsubscribe from one or more topics.
 
bool diffusion_unsubscribe_with_scope (SESSION_T *session, const char *selection_scope, const UNSUBSCRIPTION_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Unsubscribe from topics using a selection scope.
 
bool diffusion_unsubscribe_all_scopes (SESSION_T *session, const UNSUBSCRIPTION_ALL_SCOPES_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Unsubscribe topics from all topic selection scopes.
 
void notify_subscription_register (SESSION_T *session, const NOTIFY_SUBSCRIPTION_PARAMS_T params)
 Register to receive subscription notifications.
 
void notify_unsubscription_register (SESSION_T *session, const NOTIFY_UNSUBSCRIPTION_PARAMS_T params)
 Register to receive unsubscription notifications.
 

Detailed Description

Function Documentation

◆ diffusion_fetch_request_dup()

DIFFUSION_FETCH_REQUEST_T * diffusion_fetch_request_dup ( const DIFFUSION_FETCH_REQUEST_T fetch_request)

Create a duplicate (copy) of an existing DIFFUSION_FETCH_REQUEST_T.

diffusion_fetch_request_free should be called on this pointer when no longer needed.

Parameters
fetch_requestfetch request to be duplicated
Returns
a copy of the provided fetch request. NULL, if the fetch request is NULL.

◆ diffusion_fetch_request_free()

void diffusion_fetch_request_free ( DIFFUSION_FETCH_REQUEST_T fetch_request)

Free a memory allocated DIFFUSION_FETCH_REQUEST_T

Parameters
fetch_requestThe fetch request to be freed

◆ diffusion_fetch_request_init()

DIFFUSION_FETCH_REQUEST_T * diffusion_fetch_request_init ( SESSION_T session)

Creates an unconfigured fetch request.

Parameters
sessionThe session handle. If NULL, the function returns NULL.
Returns
a new unconfigured fetch request

◆ diffusion_subscribe_with_scope()

TOPIC_HANDLER_T diffusion_subscribe_with_scope ( SESSION_T session,
const char *  selection_scope,
const SUBSCRIPTION_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Request subscription to topics using a scope selection.

The session will become subscribed to each existing topic matching the selector unless the session is already subscribed to the topic, or the session does not have READ_TOPIC permission for the topic path. For each topic to which the session becomes subscribed, a subscription notification and initial value (if any) will be delivered to registered value streams.

The subscription request is also retained at the server and the session will be automatically subscribed to newly created topics that match the selector (unless a subsequent unsubscription cancels the request).

Parameters
sessionThe session handle. If NULL, this function returns immediately.
scopeSpecifies the scope of the selection.
paramsParameters describing the subscription request and callbacks handlers which may be invoked in response.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful, false otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
Since
6.12

◆ diffusion_unsubscribe_all_scopes()

bool diffusion_unsubscribe_all_scopes ( SESSION_T session,
const UNSUBSCRIPTION_ALL_SCOPES_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Unsubscribe topics from all topic selection scopes.

This can be used at any time whilst connected to reduce the set of topics to which the session is subscribed or negate earlier subscription requests and will apply to all scopes in use.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the unsubscription request and callback handlers which may be invoked in response.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful, false otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
Since
6.12

◆ diffusion_unsubscribe_with_scope()

bool diffusion_unsubscribe_with_scope ( SESSION_T session,
const char *  selection_scope,
const UNSUBSCRIPTION_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Unsubscribe from topics using a selection scope.

This can be used at any time whilst connected to reduce the set of topics to which the session is subscribed or negate earlier subscription requests.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
scopeSpecifies the scope of the selection.
paramsParameters describing the unsubscription request and callback handlers which may be invoked in response.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful, false otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
Since
6.12

◆ notify_subscription_register()

void notify_subscription_register ( SESSION_T session,
const NOTIFY_SUBSCRIPTION_PARAMS_T  params 
)

Register to receive subscription notifications.

This function should be called by the application to register to receive notifications that it has been subscribed to a topic.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsCallbacks and other parameters. on_notify_subscription should be set to receive notifications.

◆ notify_unsubscription_register()

void notify_unsubscription_register ( SESSION_T session,
const NOTIFY_UNSUBSCRIPTION_PARAMS_T  params 
)

Register to receive unsubscription notifications.

This function should be called by the application to receive notifications that it has been unsubscribed to a topic.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsCallbacks and other parameters. on_notify_unsubscription should be set to receive notifications.

◆ subscribe()

TOPIC_HANDLER_T subscribe ( SESSION_T session,
const SUBSCRIPTION_PARAMS_T  params 
)

Request subscription to topic.

This is equivalent to calling diffusion_subscribe_with_scope specifying DEFAULT_SELECTION_SCOPE.

Parameters
sessionThe session handle. If NULL, the function returns immediately.
paramsParameters describing the subscription request and callbacks handlers which may be invoked in response.
Returns
Previous topic handler if replacing, else NULL.

◆ unsubscribe()

void unsubscribe ( SESSION_T session,
const UNSUBSCRIPTION_PARAMS_T  params 
)

Unsubscribe from one or more topics.

This is equivalent to calling diffusion_unsubscribe_with_scope specifying DEFAULT_SELECTION_SCOPE.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the unsubscription request and callback handlers which may be invoked in response.