Diffusion C API 6.11.8
Loading...
Searching...
No Matches
Subscription Control

Files

file  subscription-control.h
 This feature allows a session to subscribe or unsubscribe other sessions to topics, on a single server or across a cluster.

Functions

void subscribe_client (SESSION_T *session, const SUBSCRIPTION_CONTROL_PARAMS_T params)
 Subscribe a session to topics.
void unsubscribe_client (SESSION_T *session, const SUBSCRIPTION_CONTROL_PARAMS_T params)
 Unsubscribe a session from topics.
bool diffusion_subscribe_by_filter (SESSION_T *session, const DIFFUSION_SUBSCRIBE_BY_FILTER_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Subscribe sessions that satisfy a given session filter to topics.
bool diffusion_unsubscribe_by_filter (SESSION_T *session, const DIFFUSION_UNSUBSCRIBE_BY_FILTER_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Unsubscribe sessions that satisfy a given session filter from topics.

Detailed Description

Function Documentation

◆ diffusion_subscribe_by_filter()

bool diffusion_subscribe_by_filter ( SESSION_T * session,
const DIFFUSION_SUBSCRIBE_BY_FILTER_PARAMS_T params,
DIFFUSION_API_ERROR * api_error )

Subscribe sessions that satisfy a given session filter to topics.

For each session that matches the filter, new subscriptions will be established for existing topics that match the provided topic selector and for which the sessions has READ_TOPIC permission. The topic selector will be added to the topic selections of the subscribed session, and re-evaluated when new topics are added or the session's security roles change.

A session that does not have SELECT_TOPIC permission for a topic cannot subscribe directly, but can be subscribed indirectly using this method.

This function requests that a client is subscribed to the topics specified by a topic selector.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the diffusion_subscribe_by_filter 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.

◆ diffusion_unsubscribe_by_filter()

bool diffusion_unsubscribe_by_filter ( SESSION_T * session,
const DIFFUSION_UNSUBSCRIBE_BY_FILTER_PARAMS_T params,
DIFFUSION_API_ERROR * api_error )

Unsubscribe sessions that satisfy a given session filter from topics.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the diffusion_unsubscribe_by_filter 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.

◆ subscribe_client()

void subscribe_client ( SESSION_T * session,
const SUBSCRIPTION_CONTROL_PARAMS_T params )

Subscribe a session to topics.

This function requests that a client is subscribed to the topics specified by a topic selector.

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

◆ unsubscribe_client()

void unsubscribe_client ( SESSION_T * session,
const SUBSCRIPTION_CONTROL_PARAMS_T params )

Unsubscribe a session from topics.

This function requests that a client is unsubscribed from the topics specified by a topic selector.

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