dxFeed Graal Native SDK 3.15.0-rc1
Loading...
Searching...
No Matches
SubscriptionController

The controller of the underlying subscription of a subscription or of a model: attaching it to feeds, the events batch limit, the aggregation period and the executor. More...

Data Structures

struct  dxfg_subscription_controller_t
 A handle of a Java SubscriptionController object; release it with dxfg_JavaObjectHandler_release(). More...

Typedefs

typedef struct dxfg_subscription_controller_t dxfg_subscription_controller_t
 A handle of a Java SubscriptionController object; release it with dxfg_JavaObjectHandler_release().

Functions

int32_t dxfg_SubscriptionController_attach (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, dxfg_feed_t *feed)
int32_t dxfg_SubscriptionController_detach (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, dxfg_feed_t *feed)
int32_t dxfg_SubscriptionController_getEventsBatchLimit (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, DXFG_OUT int32_t *eventsBatchLimit)
int32_t dxfg_SubscriptionController_setEventsBatchLimit (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, int32_t eventsBatchLimit)
int32_t dxfg_SubscriptionController_getAggregationPeriod (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, DXFG_OUT dxfg_time_period_t **aggregationPeriod)
int32_t dxfg_SubscriptionController_getAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, DXFG_OUT int64_t *aggregationPeriod)
int32_t dxfg_SubscriptionController_setAggregationPeriod (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, dxfg_time_period_t *aggregationPeriod)
int32_t dxfg_SubscriptionController_setAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, int64_t aggregationPeriod)
int32_t dxfg_SubscriptionController_getExecutor (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, DXFG_OUT dxfg_executor_t **executor)
int32_t dxfg_SubscriptionController_setExecutor (graal_isolatethread_t *thread, dxfg_subscription_controller_t *subscriptionController, dxfg_executor_t *executor)

Detailed Description

The controller of the underlying subscription of a subscription or of a model: attaching it to feeds, the events batch limit, the aggregation period and the executor.

A subscription controller is returned by dxfg_DXFeedSubscription_getSubscriptionController() and by the models (e.g. dxfg_IndexedEventTxModel_getSubscriptionController()). It manages the underlying subscription of that subscription or model. It is marked as experimental in the Java API.

The ownership rules (handles) are the ones of the group Javac. A handle that a function returns (in an [out] parameter) is owned by the caller and is released with dxfg_JavaObjectHandler_release(). A handle that is passed to a function is only read by the SDK: the caller keeps its ownership. Every function returns DXFG_EXECUTE_SUCCESSFULLY (0), or DXFG_EXECUTE_FAIL (-1) on error (an [out] parameter that is NULL is an error as well, and an [out] parameter is written on success only). dxfg_get_and_clear_thread_exception_t() gives the exception.

Typedef Documentation

◆ dxfg_subscription_controller_t

typedef struct dxfg_subscription_controller_t dxfg_subscription_controller_t

A handle of a Java SubscriptionController object; release it with dxfg_JavaObjectHandler_release().

Get it with dxfg_DXFeedSubscription_getSubscriptionController() or from a model. Releasing the handle does not affect the subscription.

Javadoc

Function Documentation

◆ dxfg_SubscriptionController_attach()

int32_t dxfg_SubscriptionController_attach ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
dxfg_feed_t * feed )

Attaches the underlying subscription to the specified feed.

The attached subscription receives the events of the feed. It can be attached to several feeds at the same time, but this is rarely necessary and is not recommended.

Deprecated
Use dxfg_v4_SubscriptionController_attach() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]feedThe feed to attach to.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.attach(DXFeed).

See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/SubscriptionController.html#attach-com.dxfeed.api.DXFeed-

◆ dxfg_SubscriptionController_detach()

int32_t dxfg_SubscriptionController_detach ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
dxfg_feed_t * feed )

Detaches the underlying subscription from the specified feed.

Deprecated
Use dxfg_v4_SubscriptionController_detach() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]feedThe feed to detach from.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.detach(DXFeed).

See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/SubscriptionController.html#detach-com.dxfeed.api.DXFeed-

◆ dxfg_SubscriptionController_getAggregationPeriod()

int32_t dxfg_SubscriptionController_getAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
DXFG_OUT dxfg_time_period_t ** aggregationPeriod )

Returns the aggregation period for data for this underlying subscription.

Deprecated
Use dxfg_v4_SubscriptionController_getAggregationPeriod() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[out]aggregationPeriodThe aggregation period for data, represented as a TimePeriod object. It is NULL if no aggregation period was set. Release the handle with dxfg_JavaObjectHandler_release(). It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when aggregationPeriod is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.getAggregationPeriod().

◆ dxfg_SubscriptionController_getAggregationPeriodMillis()

int32_t dxfg_SubscriptionController_getAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
DXFG_OUT int64_t * aggregationPeriod )

Returns the aggregation period for data for this underlying subscription in millis.

The function fails if no aggregation period was set (the Java side throws a NullPointerException): use dxfg_SubscriptionController_getAggregationPeriod(), which gives NULL in this case.

Deprecated
Use dxfg_v4_SubscriptionController_getAggregationPeriodMillis() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[out]aggregationPeriodThe aggregation period for data, represented as a timestamp in millis. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when aggregationPeriod is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.getAggregationPeriod().

◆ dxfg_SubscriptionController_getEventsBatchLimit()

int32_t dxfg_SubscriptionController_getEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
DXFG_OUT int32_t * eventsBatchLimit )

Returns maximum number of events in the single notification of the listener. This is not a strict guarantee, some implementations may exceed the limit.

Deprecated
Use dxfg_v4_SubscriptionController_getEventsBatchLimit() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[out]eventsBatchLimitThe maximum number of events in the single notification of the listener: 0 for the optimal limit (the default), INT32_MAX for the maximum limit. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when eventsBatchLimit is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.getEventsBatchLimit().

◆ dxfg_SubscriptionController_getExecutor()

int32_t dxfg_SubscriptionController_getExecutor ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
DXFG_OUT dxfg_executor_t ** executor )

Returns executor for processing event notifications on this underlying subscription.

Deprecated
Use dxfg_v4_SubscriptionController_getExecutor() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[out]executorThe executor for processing event notifications on this underlying subscription. Or NULL if the default executor is used. Release the handle with dxfg_JavaObjectHandler_release(). It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when executor is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.getExecutor().

◆ dxfg_SubscriptionController_setAggregationPeriod()

int32_t dxfg_SubscriptionController_setAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
dxfg_time_period_t * aggregationPeriod )

Sets the aggregation period for data that limits the rate of data notifications. For example, setting the value to 0.1s limits notification to once every 100ms (at most 10 per second). The new aggregation period will take effect during the next iteration of data notification.

Deprecated
Use dxfg_v4_SubscriptionController_setAggregationPeriod() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]aggregationPeriodThe aggregation period for data. The controller does not take the handle: release it with dxfg_JavaObjectHandler_release() when it is no longer needed. For a subscription the period must not exceed 24 hours.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.setAggregationPeriod(TimePeriod).

◆ dxfg_SubscriptionController_setAggregationPeriodMillis()

int32_t dxfg_SubscriptionController_setAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
int64_t aggregationPeriod )

Sets the aggregation period for data that limits the rate of data notifications. For example, setting the value to 100 limits notification to once every 100ms (at most 10 per second). The new aggregation period will take effect during the next iteration of data notification.

Deprecated
Use dxfg_v4_SubscriptionController_setAggregationPeriodMillis() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]aggregationPeriodThe aggregation period for data in millis. For a subscription it must not exceed 24 hours (86400000).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.setAggregationPeriod(TimePeriod), called with TimePeriod.valueOf(long).

◆ dxfg_SubscriptionController_setEventsBatchLimit()

int32_t dxfg_SubscriptionController_setEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
int32_t eventsBatchLimit )

Sets maximum number of events in the single notification of the listener. This is not a strict guarantee, some implementations may exceed the limit.

Deprecated
Use dxfg_v4_SubscriptionController_setEventsBatchLimit() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]eventsBatchLimitThe notification events limit: 0 for the optimal limit (the default), INT32_MAX for the maximum limit. It must not be negative.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (for example, for a negative limit). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.setEventsBatchLimit(int).

◆ dxfg_SubscriptionController_setExecutor()

int32_t dxfg_SubscriptionController_setExecutor ( graal_isolatethread_t * thread,
dxfg_subscription_controller_t * subscriptionController,
dxfg_executor_t * executor )

Changes executor for processing event notifications on this underlying subscription.

The controller does not take the handle of the executor: release it with dxfg_JavaObjectHandler_release() when it is no longer needed.

Deprecated
Use dxfg_v4_SubscriptionController_setExecutor() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subscriptionControllerThe subscription controller handle.
[in]executorThe executor for processing event notifications on this underlying subscription. Or NULL if the default executor is used.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: SubscriptionController.setExecutor(Executor).