dxFeed Graal Native SDK 3.15.0
Loading...
Searching...
No Matches
Subscription

Subscriptions to the events of a feed: the event types and the symbols, the listeners of events and of the changes of the subscription, the executor, the aggregation period and the batch limit. More...

Data Structures

struct  dxfg_subscription_t
 A handle of a Java DXFeedSubscription object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_time_series_subscription_t
 A handle of a Java DXFeedTimeSeriesSubscription object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_feed_event_listener_t
 A handle of a Java DXFeedEventListener object; release it with dxfg_JavaObjectHandler_release(). More...

Typedefs

typedef struct dxfg_subscription_t dxfg_subscription_t
 A handle of a Java DXFeedSubscription object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_time_series_subscription_t dxfg_time_series_subscription_t
 A handle of a Java DXFeedTimeSeriesSubscription object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_feed_event_listener_t dxfg_feed_event_listener_t
 A handle of a Java DXFeedEventListener object; release it with dxfg_JavaObjectHandler_release().
typedef void(*) dxfg_feed_event_listener_function(graal_isolatethread_t *thread, dxfg_event_type_list *events, void *user_data)
 The function of a dxfg_feed_event_listener_t: called when events are received.

Functions

dxfg_subscription_t * dxfg_DXFeedSubscription_new (graal_isolatethread_t *thread, dxfg_event_clazz_t eventClazz)
dxfg_subscription_t * dxfg_DXFeedSubscription_new2 (graal_isolatethread_t *thread, dxfg_event_clazz_list_t *eventClazzes)
int32_t dxfg_DXFeedSubscription_getSubscriptionController (graal_isolatethread_t *thread, dxfg_subscription_t *sub, DXFG_OUT dxfg_subscription_controller_t **subscriptionController)
int32_t dxfg_DXFeedSubscription_attach (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_feed_t *feed)
int32_t dxfg_DXFeedSubscription_detach (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_feed_t *feed)
int32_t dxfg_DXFeedSubscription_isClosed (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_close (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
dxfg_event_clazz_list_t * dxfg_DXFeedSubscription_getEventTypes (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_containsEventType (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_event_clazz_t eventClazz)
int32_t dxfg_DXFeedSubscription_clear (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
dxfg_symbol_list * dxfg_DXFeedSubscription_getSymbols (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
dxfg_symbol_list * dxfg_DXFeedSubscription_getDecoratedSymbols (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_setSymbol (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_t *symbol)
int32_t dxfg_DXFeedSubscription_setSymbols (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_list *symbols)
int32_t dxfg_DXFeedSubscription_addSymbol (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_t *symbol)
int32_t dxfg_DXFeedSubscription_addSymbols (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_list *symbols)
int32_t dxfg_DXFeedSubscription_removeSymbol (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_t *symbol)
int32_t dxfg_DXFeedSubscription_removeSymbols (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_symbol_list *symbols)
dxfg_executor_t * dxfg_DXFeedSubscription_getExecutor (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_setExecutor (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_executor_t *executor)
dxfg_time_period_t * dxfg_DXFeedSubscription_getAggregationPeriod (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_getAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_subscription_t *sub, DXFG_OUT int64_t *aggregationPeriod)
int32_t dxfg_DXFeedSubscription_setAggregationPeriod (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_time_period_t *period)
int32_t dxfg_DXFeedSubscription_setAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_subscription_t *sub, int64_t aggregationPeriod)
int32_t dxfg_DXFeedSubscription_getAggregationPeriodInfo (graal_isolatethread_t *thread, dxfg_subscription_t *sub, DXFG_OUT int64_t *min, DXFG_OUT int64_t *max)
int32_t dxfg_DXFeedSubscription_getTotalDroppedEvents (graal_isolatethread_t *thread, dxfg_subscription_t *sub, DXFG_OUT int64_t *droppedEvents)
dxfg_feed_event_listener_t * dxfg_DXFeedEventListener_new (graal_isolatethread_t *thread, dxfg_feed_event_listener_function user_func, void *user_data)
int32_t dxfg_DXFeedSubscription_addEventListener (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_feed_event_listener_t *listener)
int32_t dxfg_DXFeedSubscription_removeEventListener (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_feed_event_listener_t *listener)
int32_t dxfg_DXFeedSubscription_addChangeListener (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_observable_subscription_change_listener_t *listener)
int32_t dxfg_DXFeedSubscription_removeChangeListener (graal_isolatethread_t *thread, dxfg_subscription_t *sub, dxfg_observable_subscription_change_listener_t *listener)
int32_t dxfg_DXFeedSubscription_getEventsBatchLimit (graal_isolatethread_t *thread, dxfg_subscription_t *sub)
int32_t dxfg_DXFeedSubscription_setEventsBatchLimit (graal_isolatethread_t *thread, dxfg_subscription_t *sub, int32_t eventsBatchLimit)

Detailed Description

Subscriptions to the events of a feed: the event types and the symbols, the listeners of events and of the changes of the subscription, the executor, the aggregation period and the batch limit.

A subscription (dxfg_subscription_t) is interested in the events whose type is in its set of event types and whose symbol is in its set of symbols. The event types are set when the subscription is created, the symbols can be changed at any time. A subscription created by dxfg_DXFeedSubscription_new() or dxfg_DXFeedSubscription_new2() is detached: it is not attached to any feed and receives no events. Attach it with dxfg_DXFeedSubscription_attach(). A subscription created by a feed (e.g. dxfg_DXFeed_createSubscription()) is attached to that feed. A time series subscription (dxfg_time_series_subscription_t) is a subscription for the time series events that is created by a feed with dxfg_DXFeed_createTimeSeriesSubscription().

The events are passed to the event listeners (see dxfg_DXFeedEventListener_new()) by the executor of the subscription, one batch after another. Add the event listeners before the symbols: the listeners receive the last events of the symbols that were added. The changes of the subscription are passed to the change listeners (see dxfg_ObservableSubscriptionChangeListener_new()).

A subscription is closed only by dxfg_DXFeedSubscription_close(): releasing its handle does not close it. A subscription that stays attached to a feed keeps receiving events and is not freed, so close it when it is not needed any more.

The ownership rules (handles, strings, lists) are the ones of the group Javac. A symbol or a list that is passed to a function is only read by the SDK: the caller keeps its ownership. A list that a function returns is released by the caller with the function given in the description of the function. The value that a function returns on error is given in its @return. dxfg_get_and_clear_thread_exception_t() gives the exception.

Typedef Documentation

◆ dxfg_feed_event_listener_function

typedef void(*) dxfg_feed_event_listener_function(graal_isolatethread_t *thread, dxfg_event_type_list *events, void *user_data)

The function of a dxfg_feed_event_listener_t: called when events are received.

The function is called by a thread of the executor of the subscription (the default executor of the feed's endpoint, or the executor set by dxfg_DXFeedSubscription_setExecutor()), not by the thread that added the listener. The calls for one subscription do not overlap: the next batch of events is passed after the function returns for the previous one. The number of events in a batch is limited by the events batch limit (see dxfg_DXFeedSubscription_setEventsBatchLimit()).

The list and the events belong to the SDK: it frees them (with their strings) after the function returns. Do not release them, copy what you need to keep.

Java: DXFeedEventListener.eventsReceived(List).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventsThe received events.
[in]user_dataThe pointer that was passed to dxfg_DXFeedEventListener_new(); the SDK does not use it.

◆ dxfg_feed_event_listener_t

typedef struct dxfg_feed_event_listener_t dxfg_feed_event_listener_t

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

The listener calls a dxfg_feed_event_listener_function with the received events. Create it with dxfg_DXFeedEventListener_new(). The last handle of the listener that is released deactivates the listener: its function is not called anymore.

Javadoc

◆ dxfg_subscription_t

typedef struct dxfg_subscription_t dxfg_subscription_t

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

Create it with dxfg_DXFeedSubscription_new(), dxfg_DXFeedSubscription_new2() or with a feed (e.g. dxfg_DXFeed_createSubscription()). Releasing the handle does not close the subscription: call dxfg_DXFeedSubscription_close().

Javadoc

◆ dxfg_time_series_subscription_t

typedef struct dxfg_time_series_subscription_t dxfg_time_series_subscription_t

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

A time series subscription is a subscription (dxfg_subscription_t) for the events that are time series: pass &sub->sub to the functions of this header. The symbols that are set are wrapped, for the listeners of the changes, with the time from which the events are subscribed (see dxfg_DXFeedTimeSeriesSubscription_setFromTime()). Create it with dxfg_DXFeed_createTimeSeriesSubscription() or dxfg_DXFeed_createTimeSeriesSubscription2().

Javadoc

Function Documentation

◆ dxfg_DXFeedEventListener_new()

dxfg_feed_event_listener_t * dxfg_DXFeedEventListener_new ( graal_isolatethread_t * thread,
dxfg_feed_event_listener_function user_func,
void * user_data )

Creates a new event listener.

The listener calls the function with the events that the subscription receives, see dxfg_feed_event_listener_function for the thread of the call and the ownership of the events. Add the listener to a subscription with dxfg_DXFeedSubscription_addEventListener().

Deprecated
Use dxfg_v4_DXFeedEventListener_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_funcThe function to call with the received events.
[in]user_dataThe user data to pass to the function; the SDK does not use or free it.
Returns
The listener (release it with dxfg_JavaObjectHandler_release()) or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. Releasing the last handle of the listener with dxfg_JavaObjectHandler_release() (or dxfg_NativeListener_deactivate()) stops the calls of the function: the user data can be freed after that.

Java: DXFeedEventListener (eventsReceived(List)).

◆ dxfg_DXFeedSubscription_addChangeListener()

int32_t dxfg_DXFeedSubscription_addChangeListener ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_observable_subscription_change_listener_t * listener )

Adds the change listener to the subscription.

Create the listener with dxfg_ObservableSubscriptionChangeListener_new(). If the listener was not added yet, is added to an open subscription and the subscription has symbols, the listener is notified immediately of the existing symbols (its symbolsAdded function) on the calling thread before the function returns. After that it is notified of every change on the thread that changes the subscription. The calls of the listener for one subscription do not overlap. Adding a listener that is already added, or to a closed subscription, does nothing.

Deprecated
Use dxfg_v4_DXFeedSubscription_addChangeListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]listenerThe change listener.
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: DXFeedSubscription.addChangeListener(ObservableSubscriptionChangeListener).

◆ dxfg_DXFeedSubscription_addEventListener()

int32_t dxfg_DXFeedSubscription_addEventListener ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_feed_event_listener_t * listener )

Adds the event listener to the subscription. Add the listeners before the symbols: QD fails with IllegalStateException when a listener is added to an attached subscription that already has symbols.

The listener is added to the subscription, not owned by it: release its handle with dxfg_JavaObjectHandler_release() when it is no longer needed. Adding a listener to a closed subscription does nothing.

Deprecated
Use dxfg_v4_DXFeedSubscription_addEventListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription.
[in]listenerThe listener.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription.addEventListener(DXFeedEventListener).

◆ dxfg_DXFeedSubscription_addSymbol()

int32_t dxfg_DXFeedSubscription_addSymbol ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_t * symbol )

Adds the symbol to the set of the subscribed symbols.

The event listeners receive the last event of the symbol. The change listeners are notified of the added symbol on the calling thread before the function returns.

Deprecated
Use dxfg_v4_DXFeedSubscription_addSymbol().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolThe symbol. It is only read: the caller keeps its ownership.
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: DXFeedSubscription.addSymbols(Object).

◆ dxfg_DXFeedSubscription_addSymbols()

int32_t dxfg_DXFeedSubscription_addSymbols ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_list * symbols )

Adds the symbols of the list to the set of the subscribed symbols.

The event listeners receive the last events of the symbols that were added. The change listeners are notified of the added symbols on the calling thread before the function returns. Prefer this function to dxfg_DXFeedSubscription_addSymbol() for several symbols.

Deprecated
Use dxfg_v4_DXFeedSubscription_addSymbols().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolsThe symbols. The list is only read: the caller keeps its ownership.
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: DXFeedSubscription.addSymbols(Collection).

◆ dxfg_DXFeedSubscription_attach()

int32_t dxfg_DXFeedSubscription_attach ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_feed_t * feed )

Attaches the subscription to the specified feed.

The attached subscription receives the events of the feed for its symbols. It can be attached to several feeds at the same time, but it cannot be known which feed an event came from.

Deprecated
Use dxfg_v4_DXFeedSubscription_attach().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription 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: DXFeedSubscription.attach(DXFeed).

◆ dxfg_DXFeedSubscription_clear()

int32_t dxfg_DXFeedSubscription_clear ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Clears the set of the subscribed symbols.

It is the same as setting an empty list of symbols with dxfg_DXFeedSubscription_setSymbols().

Deprecated
Use dxfg_v4_DXFeedSubscription_clear().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
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: DXFeedSubscription.clear().

◆ dxfg_DXFeedSubscription_close()

int32_t dxfg_DXFeedSubscription_close ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Closes the subscription and makes it permanently detached from all feeds.

The subscription removes all its event listeners and change listeners and does not accept new ones. Every change listener is notified of the close (its subscriptionClosed function, see dxfg_ObservableSubscriptionChangeListener_new()) on the calling thread before the function returns. The handle is not released: release it with dxfg_JavaObjectHandler_release(). Closing a closed subscription does nothing.

An event listener may still receive one more batch of events after the function returns. To be sure that its function is not called anymore, release the listener (dxfg_JavaObjectHandler_release()) or deactivate it (dxfg_NativeListener_deactivate()).

Deprecated
Use dxfg_v4_DXFeedSubscription_close().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
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: DXFeedSubscription.close().

◆ dxfg_DXFeedSubscription_containsEventType()

int32_t dxfg_DXFeedSubscription_containsEventType ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_event_clazz_t eventClazz )

Checks whether the subscription contains the event type.

Deprecated
Use dxfg_v4_DXFeedSubscription_containsEventType().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]eventClazzThe event type.
Returns
1 if the subscription contains the event type, 0 if it does not, or -1 on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: DXFeedSubscription.containsEventType(Class).

◆ dxfg_DXFeedSubscription_detach()

int32_t dxfg_DXFeedSubscription_detach ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_feed_t * feed )

Detaches the subscription from the specified feed.

The subscription keeps its symbols and listeners, but does not receive the events of this feed any more.

Deprecated
Use dxfg_v4_DXFeedSubscription_detach().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription 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: DXFeedSubscription.detach(DXFeed).

◆ dxfg_DXFeedSubscription_getAggregationPeriod()

dxfg_time_period_t * dxfg_DXFeedSubscription_getAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the aggregation period for data of this subscription.

Deprecated
Use dxfg_v4_DXFeedSubscription_getAggregationPeriod().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The aggregation period (release the handle with dxfg_JavaObjectHandler_release()), or NULL if no period was set. NULL is also returned on error: use dxfg_get_and_clear_thread_exception_t() to get the exception and to tell the two cases apart.

Java: DXFeedSubscription.getAggregationPeriod().

◆ dxfg_DXFeedSubscription_getAggregationPeriodInfo()

int32_t dxfg_DXFeedSubscription_getAggregationPeriodInfo ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
DXFG_OUT int64_t * min,
DXFG_OUT int64_t * max )

Returns the aggregation period that was applied to the events delivered to this subscription.

The value is updated when the events are delivered to the listeners: both bounds are negative (unknown) before the first events arrive.

Java: DXFeedSubscription.getAggregationPeriodInfo(), TimePeriodInfo.getMin(), TimePeriodInfo.getMax().

Deprecated
Use dxfg_v4_DXFeedSubscription_getAggregationPeriodInfo().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[out]minThe minimum aggregation period in millis, negative if unknown. It is written on success only.
[out]maxThe maximum aggregation period in millis, negative if unknown. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when min or max is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXFeedSubscription_getAggregationPeriodMillis()

int32_t dxfg_DXFeedSubscription_getAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
DXFG_OUT int64_t * aggregationPeriod )

Returns the aggregation period (in millis) for data for this subscription instance.

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

Deprecated
Use dxfg_v4_DXFeedSubscription_getAggregationPeriodMillis().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[out]aggregationPeriodA pointer to the aggregation period 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: DXFeedSubscription.getAggregationPeriod().

◆ dxfg_DXFeedSubscription_getDecoratedSymbols()

dxfg_symbol_list * dxfg_DXFeedSubscription_getDecoratedSymbols ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the subscribed symbols as the change listeners see them.

For a time series subscription every symbol is wrapped with the time of the subscription (dxfg_time_series_subscription_symbol_t); for any other subscription the result is the same as of dxfg_DXFeedSubscription_getSymbols(). The list is a copy of the symbols at the moment of the call.

Deprecated
Use dxfg_v4_DXFeedSubscription_getDecoratedSymbols().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The list of the symbols (release it with dxfg_CList_symbol_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription.getDecoratedSymbols().

◆ dxfg_DXFeedSubscription_getEventsBatchLimit()

int32_t dxfg_DXFeedSubscription_getEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the maximum number of events in a single notification of the event listeners.

It is not a strict guarantee: the notification may exceed the limit. 0 means the optimal limit (the default), INT32_MAX means the maximum limit.

Deprecated
Use dxfg_v4_DXFeedSubscription_getEventsBatchLimit().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The events batch limit, or -1 on error (a valid limit is never negative). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: DXFeedSubscription.getEventsBatchLimit().

◆ dxfg_DXFeedSubscription_getEventTypes()

dxfg_event_clazz_list_t * dxfg_DXFeedSubscription_getEventTypes ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the event types of the subscription.

Deprecated
Use dxfg_v4_DXFeedSubscription_getEventTypes().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The list of the event types (release it with dxfg_CList_EventClazz_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription.getEventTypes().

◆ dxfg_DXFeedSubscription_getExecutor()

dxfg_executor_t * dxfg_DXFeedSubscription_getExecutor ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the executor that processes the event notifications of the subscription.

Deprecated
Use dxfg_v4_DXFeedSubscription_getExecutor().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The executor (release the handle with dxfg_JavaObjectHandler_release()), or NULL if the default executor of the attached feed is used. NULL is also returned on error: use dxfg_get_and_clear_thread_exception_t() to get the exception and to tell the two cases apart.

Java: DXFeedSubscription.getExecutor().

◆ dxfg_DXFeedSubscription_getSubscriptionController()

int32_t dxfg_DXFeedSubscription_getSubscriptionController ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
DXFG_OUT dxfg_subscription_controller_t ** subscriptionController )

Returns the subscription controller for this subscription.

The controller manages the same subscription: attaching to feeds, the batch limit, the aggregation period and the executor (see the group SubscriptionController).

Deprecated
Use dxfg_v4_DXFeedSubscription_getSubscriptionController() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[out]subscriptionControllerThe pointer to the handle of the subscription controller of this subscription. It is written on success only; release the handle with dxfg_JavaObjectHandler_release().
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when subscriptionController is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: DXFeedSubscription.getSubscriptionController().

◆ dxfg_DXFeedSubscription_getSymbols()

dxfg_symbol_list * dxfg_DXFeedSubscription_getSymbols ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Returns the subscribed symbols as they were set.

For a time series subscription these are the original symbols, without the time of the subscription (see dxfg_DXFeedSubscription_getDecoratedSymbols()). The list is a copy of the symbols at the moment of the call.

Deprecated
Use dxfg_v4_DXFeedSubscription_getSymbols().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
The list of the symbols (release it with dxfg_CList_symbol_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription.getSymbols().

◆ dxfg_DXFeedSubscription_getTotalDroppedEvents()

int32_t dxfg_DXFeedSubscription_getTotalDroppedEvents ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
DXFG_OUT int64_t * droppedEvents )

Returns the number of the events that were dropped because of a buffer overflow since the subscription was created.

The function is experimental: the Java method is marked @Experimental and may change.

Java: DXFeedSubscription.getTotalDroppedEvents().

Deprecated
Use dxfg_v4_DXFeedSubscription_getTotalDroppedEvents() (experimental).
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[out]droppedEventsThe number of the dropped events. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when droppedEvents is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXFeedSubscription_isClosed()

int32_t dxfg_DXFeedSubscription_isClosed ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub )

Checks whether the subscription is closed (see dxfg_DXFeedSubscription_close()).

Deprecated
Use dxfg_v4_DXFeedSubscription_isClosed().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
Returns
1 if the subscription is closed, 0 if it is not, or -1 on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: DXFeedSubscription.isClosed().

◆ dxfg_DXFeedSubscription_new()

dxfg_subscription_t * dxfg_DXFeedSubscription_new ( graal_isolatethread_t * thread,
dxfg_event_clazz_t eventClazz )

Creates a detached subscription for one event type.

The subscription is not attached to any feed: attach it with dxfg_DXFeedSubscription_attach(). The event type cannot be changed later.

Deprecated
Use dxfg_v4_DXFeedSubscription_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventClazzThe event type.
Returns
The subscription (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription(Class).

◆ dxfg_DXFeedSubscription_new2()

dxfg_subscription_t * dxfg_DXFeedSubscription_new2 ( graal_isolatethread_t * thread,
dxfg_event_clazz_list_t * eventClazzes )

Creates a detached subscription for the given event types.

The subscription is not attached to any feed: attach it with dxfg_DXFeedSubscription_attach(). The event types cannot be changed later. The list must not be empty.

Deprecated
Use dxfg_v4_DXFeedSubscription_newWithEventTypes().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventClazzesThe event types. The list is only read: the caller keeps its ownership.
Returns
The subscription (release it with dxfg_JavaObjectHandler_release()), or NULL on error (for example, for an empty list). Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription(Class...).

◆ dxfg_DXFeedSubscription_removeChangeListener()

int32_t dxfg_DXFeedSubscription_removeChangeListener ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_observable_subscription_change_listener_t * listener )

Removes the change listener from the subscription.

If the listener was added, it is notified of the removal (its subscriptionClosed function) on the calling thread before the function returns. Removing a listener that is not added does nothing.

Deprecated
Use dxfg_v4_DXFeedSubscription_removeChangeListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]listenerThe change listener.
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: DXFeedSubscription.removeChangeListener(ObservableSubscriptionChangeListener).

◆ dxfg_DXFeedSubscription_removeEventListener()

int32_t dxfg_DXFeedSubscription_removeEventListener ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_feed_event_listener_t * listener )

Removes the event listener from the subscription.

The listener may still receive one more batch of events after this function (or dxfg_DXFeedSubscription_close()) returns. Release the listener (dxfg_JavaObjectHandler_release()) or deactivate it (dxfg_NativeListener_deactivate()) to be sure that its function is not called anymore.

Deprecated
Use dxfg_v4_DXFeedSubscription_removeEventListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription.
[in]listenerThe listener.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: DXFeedSubscription.removeEventListener(DXFeedEventListener).

◆ dxfg_DXFeedSubscription_removeSymbol()

int32_t dxfg_DXFeedSubscription_removeSymbol ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_t * symbol )

Removes the symbol from the set of the subscribed symbols.

The change listeners are notified of the removed symbol on the calling thread before the function returns.

Deprecated
Use dxfg_v4_DXFeedSubscription_removeSymbol().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolThe symbol. It is only read: the caller keeps its ownership.
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: DXFeedSubscription.removeSymbols(Object...).

◆ dxfg_DXFeedSubscription_removeSymbols()

int32_t dxfg_DXFeedSubscription_removeSymbols ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_list * symbols )

Removes the symbols of the list from the set of the subscribed symbols.

The change listeners are notified of the removed symbols on the calling thread before the function returns. Prefer this function to dxfg_DXFeedSubscription_removeSymbol() for several symbols.

Deprecated
Use dxfg_v4_DXFeedSubscription_removeSymbols().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolsThe symbols. The list is only read: the caller keeps its ownership.
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: DXFeedSubscription.removeSymbols(Collection).

◆ dxfg_DXFeedSubscription_setAggregationPeriod()

int32_t dxfg_DXFeedSubscription_setAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_time_period_t * period )

Sets the aggregation period for data.

The period limits the rate of the notifications of the event listeners. The new period takes effect only after the current one elapses. The effective period is the maximum of this period and the global aggregation period of the endpoint.

Deprecated
Use dxfg_v4_DXFeedSubscription_setAggregationPeriod().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]periodThe aggregation period, or NULL to clear the previous setting. It must not exceed 24 hours. The subscription does not take the handle: release it with dxfg_JavaObjectHandler_release() when it is no longer needed.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (for example, when the period exceeds 24 hours). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: DXFeedSubscription.setAggregationPeriod(TimePeriod).

◆ dxfg_DXFeedSubscription_setAggregationPeriodMillis()

int32_t dxfg_DXFeedSubscription_setAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
int64_t aggregationPeriod )

Sets the aggregation period for data. This method sets a new aggregation period for data, which will only take effect on the next iteration of data notification. For example, if the current aggregation period is 5 seconds, and it is changed to 1 second, the next notification may come after up to 5 seconds, after which the new aggregation period will take effect. The effective period is the maximum of this period and the global aggregation period of the endpoint.

Deprecated
Use dxfg_v4_DXFeedSubscription_setAggregationPeriodMillis().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]aggregationPeriodThe aggregation period in millis. It must not exceed 24 hours (86400000).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (for example, when the period exceeds 24 hours). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

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

◆ dxfg_DXFeedSubscription_setEventsBatchLimit()

int32_t dxfg_DXFeedSubscription_setEventsBatchLimit ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
int32_t eventsBatchLimit )

Sets the maximum number of events in a single notification of the event listeners.

It is not a strict guarantee: the notification may exceed the limit. 0 means the optimal limit (the default), INT32_MAX means the maximum limit.

Deprecated
Use dxfg_v4_DXFeedSubscription_setEventsBatchLimit().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]eventsBatchLimitThe notification events 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: DXFeedSubscription.setEventsBatchLimit(int).

◆ dxfg_DXFeedSubscription_setExecutor()

int32_t dxfg_DXFeedSubscription_setExecutor ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_executor_t * executor )

Changes the executor that processes the event notifications of the subscription.

The event listeners of the subscription are called by the threads of this executor. The subscription does not take the handle of the executor: release it with dxfg_JavaObjectHandler_release() when it is no longer needed.

Deprecated
Use dxfg_v4_DXFeedSubscription_setExecutor().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]executorThe executor, or NULL to use the default executor of the attached feed.
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: DXFeedSubscription.setExecutor(Executor).

◆ dxfg_DXFeedSubscription_setSymbol()

int32_t dxfg_DXFeedSubscription_setSymbol ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_t * symbol )

Changes the set of the subscribed symbols so that it contains only the given symbol.

The event listeners receive the last events of the symbols that were added. The change listeners are notified of the added and removed symbols on the calling thread before the function returns.

Deprecated
Use dxfg_v4_DXFeedSubscription_setSymbol().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolThe symbol. It is only read: the caller keeps its ownership.
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: DXFeedSubscription.setSymbols(Object...).

◆ dxfg_DXFeedSubscription_setSymbols()

int32_t dxfg_DXFeedSubscription_setSymbols ( graal_isolatethread_t * thread,
dxfg_subscription_t * sub,
dxfg_symbol_list * symbols )

Changes the set of the subscribed symbols so that it contains only the symbols of the given list.

The event listeners receive the last events of the symbols that were added. The change listeners are notified of the added and removed symbols on the calling thread before the function returns. Prefer this function to dxfg_DXFeedSubscription_setSymbol() for several symbols.

Deprecated
Use dxfg_v4_DXFeedSubscription_setSymbols().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]subThe subscription handle.
[in]symbolsThe symbols. The list is only read: the caller keeps its ownership.
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: DXFeedSubscription.setSymbols(Collection).