|
dxFeed Graal Native SDK 3.13.0
|
The v4 functions and type names of the group Publisher. 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_java_object_handler | dxfg_v4_java_object_handler |
| The handle of a Java object: the reference by which the C code refers to an object that lives in Java. | |
| typedef dxfg_publisher_t | dxfg_v4_publisher_t |
| A handle of a Java DXPublisher object; release it with dxfg_JavaObjectHandler_release(). | |
| typedef dxfg_observable_subscription_t | dxfg_v4_observable_subscription_t |
| A handle of a Java ObservableSubscription object; release it with dxfg_JavaObjectHandler_release(). | |
The v4 functions and type names of the group Publisher. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions.
The handle of a Java object: the reference by which the C code refers to an object that lives in Java.
The handle is allocated by the SDK and owned by the caller: release it with dxfg_JavaObjectHandler_release(), which frees the structure and drops the reference to the Java object. As long as any handle of an object exists, the object is not garbage collected. Use dxfg_JavaObjectHandler_clone() to get another handle of the same object.
The typed handle structures (e.g. dxfg_executor_t, dxfg_time_zone_t) consist of this structure only (the field handler), so a pointer to a typed handle is passed to the functions that take a dxfg_java_object_handler * as &typed->handler (or by a cast).
Use dxfg_Object_toString() to get the string representation of the object, dxfg_Object_equals() to compare objects and dxfg_Object_hashCode() to get the hash code.
A handle of a Java ObservableSubscription object; release it with dxfg_JavaObjectHandler_release().
It is the observable set of the symbols that the feeds are subscribed to, for one event type. Get it with dxfg_DXPublisher_getSubscription(). The subscription is closed when the endpoint of the publisher is closed.
| typedef dxfg_publisher_t dxfg_v4_publisher_t |
A handle of a Java DXPublisher object; release it with dxfg_JavaObjectHandler_release().
Get it with dxfg_DXPublisher_getInstance() or dxfg_DXEndpoint_getPublisher(). Releasing the handle does not close the endpoint of the publisher.
| int32_t dxfg_v4_DXPublisher_getInstance | ( | graal_isolatethread_t * | thread, |
| DXFG_OUT dxfg_v4_publisher_t ** | publisher ) |
Returns the default application-wide singleton publisher (DXPublisher.getInstance()): the publisher of the default endpoint with the publisher role. It is configured by the system properties (see dxfg_system_set_property()) when it is first used.
All callers share this publisher and its endpoint: closing the endpoint closes it for everyone in the process.
Java: DXPublisher.getInstance().
| [in] | thread | The current GraalVM Isolate's thread. |
| [out] | publisher | The pointer to the variable that receives the publisher (release the handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL. |
| int32_t dxfg_v4_DXPublisher_getSubscription | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_publisher_t * | publisher, | ||
| dxfg_v4_event_clazz_t | eventClazz, | ||
| DXFG_OUT dxfg_v4_observable_subscription_t ** | subscription ) |
Returns the observable set of the subscribed symbols for the event type.
The symbols of the set are the symbols that the feeds are subscribed to; the set contains the wildcard symbol if there is a subscription to all symbols, and, for a time series subscription, the symbols wrapped with the time of the subscription (dxfg_v4_time_series_subscription_symbol_t). The set may notify its change listeners of the same symbols several times without a removal between the notifications: it happens when the subscription disappears, the cached data is lost and the subscription appears again. On each such notification the data provider is to publish the most recent events of the symbols (dxfg_v4_DXPublisher_publishEvents()).
Java: DXPublisher.getSubscription(Class).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | publisher | The publisher handle. |
| [in] | eventClazz | The event type. |
| [out] | subscription | The pointer to the variable that receives the observable subscription (release the handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL. |
| int32_t dxfg_v4_DXPublisher_publishEvents | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_publisher_t * | publisher, | ||
| dxfg_v4_event_type_list * | events ) |
Publishes the events to the corresponding feeds.
If the endpoint of the publisher has the publisher role and is connected, the events are delivered to the remote endpoints. The local feed of the endpoint always receives them. A feed receives an event only if it is subscribed to its symbol (or to all symbols with a wildcard, or, for a time series event, with a time series subscription for the time of the event). The published events are not stored and are lost if there is no subscription; the last events of the lasting event types are kept while the subscription to their symbol exists.
The events are serialized by the function: the list and the events are only read, the caller keeps its ownership and can reuse or release them after the function returns.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | publisher | The publisher handle. |
| [in] | events | The events to publish. |
Java: DXPublisher.publishEvents(Collection).
| int32_t dxfg_v4_ObservableSubscription_addChangeListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_observable_subscription_t * | sub, | ||
| dxfg_v4_observable_subscription_change_listener_t * | listener ) |
Adds the change listener to the observable subscription.
Create the listener with dxfg_v4_ObservableSubscriptionChangeListener_new(); see its description for the callbacks of the listener: they are called on a Java thread, not necessarily the one that added the listener, and the symbols belong to the SDK. If the listener is added to an open subscription, it is notified immediately of the existing subscription state (its symbolsAdded function) before the function returns, and after that of every change. 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.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | sub | The observable subscription handle. |
| [in] | listener | The change listener. |
Java: ObservableSubscription.addChangeListener(ObservableSubscriptionChangeListener).
| int32_t dxfg_v4_ObservableSubscription_containsEventType | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_observable_subscription_t * | sub, | ||
| dxfg_v4_event_clazz_t | eventClazz, | ||
| DXFG_OUT int32_t * | contains ) |
Checks whether the observable subscription contains the event type.
Java: ObservableSubscription.containsEventType(Class).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | sub | The observable subscription handle. |
| [in] | eventClazz | The event type. |
| [out] | contains | The pointer to the variable that receives 1 if the subscription contains the event type, 0 if it does not; must not be NULL. |
| int32_t dxfg_v4_ObservableSubscription_getEventTypes | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_observable_subscription_t * | sub, | ||
| DXFG_OUT dxfg_v4_event_clazz_list ** | eventTypes ) |
Returns the event types of the observable subscription.
The subscription of a publisher (dxfg_v4_DXPublisher_getSubscription()) has the single event type that was requested.
Java: ObservableSubscription.getEventTypes().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | sub | The observable subscription handle. |
| [out] | eventTypes | The pointer to the variable that receives the list of the event types (release it with dxfg_v4_event_clazz_list_release()); must not be NULL. |
| int32_t dxfg_v4_ObservableSubscription_isClosed | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_observable_subscription_t * | sub, | ||
| DXFG_OUT int32_t * | closed ) |
Checks whether the observable subscription is closed.
The subscription of a publisher is closed when its endpoint is closed.
Java: ObservableSubscription.isClosed().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | sub | The observable subscription handle. |
| [out] | closed | The pointer to the variable that receives 1 if the subscription is closed, 0 if it is not; must not be NULL. |
| int32_t dxfg_v4_ObservableSubscription_removeChangeListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_observable_subscription_t * | sub, | ||
| dxfg_v4_observable_subscription_change_listener_t * | listener ) |
Removes the change listener from the observable subscription.
If the listener was added, it is notified of the removal (its subscriptionClosed function) before the function returns. Removing a listener that is not added does nothing. To be sure that the functions of the listener are not called anymore, release it (dxfg_v4_JavaObjectHandler_release()) or deactivate it (dxfg_v4_NativeListener_deactivate()).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | sub | The observable subscription handle. |
| [in] | listener | The change listener. |
Java: ObservableSubscription.removeChangeListener(ObservableSubscriptionChangeListener).