dxFeed Graal Native SDK 3.17.0-rc1
Loading...
Searching...
No Matches
SubscriptionController (v4)

The v4 functions and type names of the group SubscriptionController. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions. More...

Typedefs

typedef dxfg_feed_t dxfg_v4_feed_t
 A handle of a Java DXFeed object; release it with dxfg_JavaObjectHandler_release().
typedef dxfg_subscription_controller_t dxfg_v4_subscription_controller_t
 A handle of a Java SubscriptionController object; release it with dxfg_JavaObjectHandler_release().

Functions

int32_t dxfg_v4_SubscriptionController_attach (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, dxfg_v4_feed_t *feed)
int32_t dxfg_v4_SubscriptionController_detach (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, dxfg_v4_feed_t *feed)
int32_t dxfg_v4_SubscriptionController_getEventsBatchLimit (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, DXFG_OUT int32_t *eventsBatchLimit)
int32_t dxfg_v4_SubscriptionController_setEventsBatchLimit (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, int32_t eventsBatchLimit)
int32_t dxfg_v4_SubscriptionController_getAggregationPeriod (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, DXFG_OUT dxfg_v4_time_period_t **aggregationPeriod)
int32_t dxfg_v4_SubscriptionController_getAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, DXFG_OUT int64_t *aggregationPeriod)
int32_t dxfg_v4_SubscriptionController_setAggregationPeriod (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, dxfg_v4_time_period_t *aggregationPeriod)
int32_t dxfg_v4_SubscriptionController_setAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, int64_t aggregationPeriod)
int32_t dxfg_v4_SubscriptionController_getExecutor (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, DXFG_OUT dxfg_v4_executor_t **executor)
int32_t dxfg_v4_SubscriptionController_setExecutor (graal_isolatethread_t *thread, dxfg_v4_subscription_controller_t *subscriptionController, dxfg_v4_executor_t *executor)

Detailed Description

The v4 functions and type names of the group SubscriptionController. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions.

Typedef Documentation

◆ dxfg_v4_feed_t

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

Get the feed of the default endpoint with dxfg_DXFeed_getInstance() or the feed of an endpoint with dxfg_DXEndpoint_getFeed(). Releasing the handle does not close the endpoint of the feed.

Javadoc

◆ dxfg_v4_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_v4_SubscriptionController_attach()

int32_t dxfg_v4_SubscriptionController_attach ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
dxfg_v4_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.

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_v4_get_and_clear_thread_exception() 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-
Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_detach()

int32_t dxfg_v4_SubscriptionController_detach ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
dxfg_v4_feed_t * feed )

Detaches the underlying subscription from the specified feed.

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_v4_get_and_clear_thread_exception() 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-
Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_getAggregationPeriod()

int32_t dxfg_v4_SubscriptionController_getAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
DXFG_OUT dxfg_v4_time_period_t ** aggregationPeriod )

Returns the aggregation period for data for this underlying subscription.

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_v4_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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.getAggregationPeriod().

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_getAggregationPeriodMillis()

int32_t dxfg_v4_SubscriptionController_getAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_v4_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_v4_SubscriptionController_getAggregationPeriod(), which gives NULL in this case.

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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.getAggregationPeriod().

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_getEventsBatchLimit()

int32_t dxfg_v4_SubscriptionController_getEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_v4_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.

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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.getEventsBatchLimit().

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_getExecutor()

int32_t dxfg_v4_SubscriptionController_getExecutor ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
DXFG_OUT dxfg_v4_executor_t ** executor )

Returns executor for processing event notifications on this underlying subscription.

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_v4_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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.getExecutor().

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_setAggregationPeriod()

int32_t dxfg_v4_SubscriptionController_setAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
dxfg_v4_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.

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_v4_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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.setAggregationPeriod(TimePeriod).

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_setAggregationPeriodMillis()

int32_t dxfg_v4_SubscriptionController_setAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_v4_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.

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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

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

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_setEventsBatchLimit()

int32_t dxfg_v4_SubscriptionController_setEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_v4_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.

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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.setEventsBatchLimit(int).

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_v4_SubscriptionController_setExecutor()

int32_t dxfg_v4_SubscriptionController_setExecutor ( graal_isolatethread_t * thread,
dxfg_v4_subscription_controller_t * subscriptionController,
dxfg_v4_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_v4_JavaObjectHandler_release() when it is no longer needed. As dxfg_v4_DXFeedSubscription_setExecutor(), the function fails with IllegalStateException for a subscription attached to an event queue and for the executor of an attached subscription, and accepts the executor of a shared queue (dxfg_v4_EventQueue_getExecutor()).

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_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

Java: SubscriptionController.setExecutor(Executor).

Experimental
It may change or be removed in a minor release, see The v4 functions.