dxFeed .Net API
7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
|
Subscription for a set of symbols and event types. More...
Public Member Functions | |
DXFeedSubscription (DXEndpoint endpoint) | |
Creates detached subscription for a single event type. More... | |
DXFeedSubscription (DXEndpoint endpoint, params Type[] eventTypes) | |
Creates detached subscription for the given list of event types. More... | |
void | Attach (IDXFeed feed) |
Attaches subscription to the specified feed. More... | |
void | Detach (IDXFeed feed) |
Detaches subscription from the specified feed. More... | |
void | Close () |
bool | ContainsEventType (Type eventType) |
Returns true if this subscription contains the corresponding event type. More... | |
void | Clear () |
ISet< object > | GetSymbols () |
Returns a set of subscribed symbols. The resulting set cannot be modified. The contents of the resulting set are undefined if the set of symbols is changed after invocation of this method, but the resulting set is safe for concurrent reads from any threads. The resulting set maybe either a snapshot of the set of the subscribed symbols at the time of invocation or a weakly consistent view of the set. More... | |
void | SetSymbols (ICollection< object > symbols) |
void | SetSymbols (params object[] symbols) |
void | AddSymbols (ICollection< object > symbols) |
void | AddSymbols (params object[] symbols) |
void | AddSymbols (object symbol) |
void | RemoveSymbols (ICollection< object > symbols) |
void | RemoveSymbols (params object[] symbols) |
void | AddEventListener (IDXFeedEventListener< E > listener) |
Adds listener for events. Newly added listeners start receiving only new events. This method does nothing if this subscription is IsClosed. More... | |
void | RemoveEventListener (IDXFeedEventListener< E > listener) |
Removes listener for events. More... | |
Protected Member Functions | |
DXFeedSubscription (params Type[] eventTypes) | |
void | AddSymbols (bool callUpdateEvent, params object[] symbols) |
void | Endpoint_OnClosing (object sender, EventArgs e) |
Protected Attributes | |
IDxSubscription | subscriptionInstance = null |
List< IDXFeedEventListener< E > > | eventListeners = new List<IDXFeedEventListener<E>>() |
object | eventListenerLocker = new object() |
Properties | |
bool | IsClosed [get] |
Returns true if this subscription is closed.
| |
ISet< Type > | EventTypes [get] |
Returns a set of subscribed event types. The resulting set cannot be modified. More... | |
![]() | |
bool | IsClosed [get] |
Returns true if this subscription is closed.
| |
ISet< Type > | EventTypes [get] |
Returns a set of subscribed event types. The resulting set cannot be modified. More... | |
Events | |
DXFeedSymbolsUpdateEventHandler | OnSymbolsAdded |
Event calls when any symbols is added to subscription. More... | |
DXFeedSymbolsUpdateEventHandler | OnSymbolsRemoved |
Event calls when any symbols is removed from subscription. More... | |
DXFeedSubscriptionClosedEventHandler | OnSubscriptionClosed |
Event calls when subscription is closing. More... | |
![]() | |
DXFeedSymbolsUpdateEventHandler | OnSymbolsAdded |
Event calls when any symbols is added to subscription. More... | |
DXFeedSymbolsUpdateEventHandler | OnSymbolsRemoved |
Event calls when any symbols is removed from subscription. More... | |
DXFeedSubscriptionClosedEventHandler | OnSubscriptionClosed |
Event calls when subscription is closing. More... | |
Subscription for a set of symbols and event types.
E | The type of events. |
E | : | IDxEventType |
|
inline |
Creates detached subscription for a single event type.
endpoint | The DXEndpoint instance. |
ArgumentNullException | If endpoint is null. |
ArgumentException | If type E is not event class. |
DxException | Internal error. |
|
inline |
Creates detached subscription for the given list of event types.
endpoint | The DXEndpoint instance. |
eventTypes | The list of event types. |
ArgumentNullException | If endpoint or eventTypes is null. |
ArgumentException | If eventTypes are empty or any type of eventTypes is not event class. |
DxException | Internal error. |
|
inline |
Adds listener for events. Newly added listeners start receiving only new events. This method does nothing if this subscription is IsClosed.
listener | The event listener. |
ArgumentNullException | If listener is null. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Adds the specified collection of symbols to the set of subscribed symbols. To conveniently add one or few symbols you can use AddSymbols(object[]) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.
symbols | Symbols the collection of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Adds the specified array of symbols to the set of subscribed symbols. This is a convenience method to subscribe to one or few symbols at a time. When subscribing to multiple symbols at once it is preferable to use AddSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.
symbols | The array of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Adds the specified symbol to the set of subscribed symbols. This is a convenience method to subscribe to one symbol at a time that has a return fast-path for a case when the symbol is already in the set. When subscribing to multiple symbols at once it is preferable to use AddSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.
symbol | The symbol. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inlineprotected |
Adds the specified array of symbols to the set of subscribed symbols. This is a convenience method to subscribe to one or few symbols at a time. When subscribing to multiple symbols at once it is preferable to use AddSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription. The false
value of callUpdateEvent disables calling any symbols update events for this method.
callUpdateEvent | The false value disables calling any symbols update events for this method. |
symbols | The array of symbols. |
|
inline |
Attaches subscription to the specified feed.
feed | Feed to attach to. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Clears the set of subscribed symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsRemoved events on clear symbols from this subscription.
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Closes this subscription and makes it permanently detached. This method notifies attached IDXFeed by invoking Detach(IDXFeed) and IDXFeed.DetachSubscription<E>(IDXFeedSubscription<E>) methods while holding the lock for this subscription. This method clears lists of all installed event listeners and subscription change listeners and makes sure that no more listeners can be added.
This method ensures that subscription can be safely garbage-collected when all outside references to it are lost.
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Returns true
if this subscription contains the corresponding event type.
eventType | Type of event. |
True
if this subscription contains the corresponding event type.Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Detaches subscription from the specified feed.
feed | Feed to detach from. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Returns a set of subscribed symbols. The resulting set cannot be modified. The contents of the resulting set are undefined if the set of symbols is changed after invocation of this method, but the resulting set is safe for concurrent reads from any threads. The resulting set maybe either a snapshot of the set of the subscribed symbols at the time of invocation or a weakly consistent view of the set.
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Removes listener for events.
listener | Listener the event listener. |
ArgumentNullException | If listener is null. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Removes the specified collection of symbols from the set of subscribed symbols. To conveniently remove one or few symbols you can use RemoveSymbols(object[]) method.
Implementation notes.
This method notifies all subscribed OnSymbolsRemoved events on symbols changing for this subscription.
symbols | The collection of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Removes the specified array of symbols from the set of subscribed symbols. This is a convenience method to remove one or few symbols at a time. When removing multiple symbols at once it is preferable to use RemoveSymbols(ICollection<object>) method.
Implementation notes.
This method notifies all subscribed OnSymbolsRemoved events on symbols changing for this subscription.
symbols | The array of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Changes the set of subscribed symbols so that it contains just the symbols from the specified collection. To conveniently set subscription for just one or few symbols you can use SetSymbols(object[]) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded and OnSymbolsRemoved events on symbols changing for this subscription.
symbols | The collection of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
inline |
Changes the set of subscribed symbols so that it contains just the symbols from the specified array. This is a convenience method to set subscription to one or few symbols at a time. When setting subscription to multiple symbols at once it is preferable to use SetSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsAdded and OnSymbolsRemoved events on symbols changing for this subscription.
symbols | The array of symbols. |
Implements com.dxfeed.api.IDXFeedSubscription< E >.
|
get |
Returns a set of subscribed event types. The resulting set cannot be modified.
|
get |
Returns true
if this subscription is closed.
DXFeedSubscriptionClosedEventHandler com.dxfeed.api.DXFeedSubscription< E >.OnSubscriptionClosed |
Event calls when subscription is closing.
DXFeedSymbolsUpdateEventHandler com.dxfeed.api.DXFeedSubscription< E >.OnSymbolsAdded |
Event calls when any symbols is added to subscription.
DXFeedSymbolsUpdateEventHandler com.dxfeed.api.DXFeedSubscription< E >.OnSymbolsRemoved |
Event calls when any symbols is removed from subscription.