dxFeed .Net API
5.8.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 | |
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... | |
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... | |
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... | |
Subscription for a set of symbols and event types.
E | The type of events. |
E | : | IDxEventType |
void com.dxfeed.api.IDXFeedSubscription< E >.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.
listener | The event listener. |
ArgumentNullException | If listener is null. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols | ( | ICollection< object > | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols | ( | params object [] | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols | ( | object | symbol | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.Attach | ( | IDXFeed | feed | ) |
Attaches subscription to the specified feed.
feed | Feed to attach to. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.Clear | ( | ) |
Clears the set of subscribed symbols.
Implementation notes.
This method notifies all subscribed OnSymbolsRemoved events on clear symbols from this subscription.
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.Close | ( | ) |
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.
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
bool com.dxfeed.api.IDXFeedSubscription< E >.ContainsEventType | ( | Type | eventType | ) |
Returns true
if this subscription contains the corresponding event type.
eventType | Type of event. |
True
if this subscription contains the corresponding event type.Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.Detach | ( | IDXFeed | feed | ) |
Detaches subscription from the specified feed.
feed | Feed to detach from. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
ISet<object> com.dxfeed.api.IDXFeedSubscription< E >.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.
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.RemoveEventListener | ( | IDXFeedEventListener< E > | listener | ) |
Removes listener for events.
listener | Listener the event listener. |
ArgumentNullException | If listener is null. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.RemoveSymbols | ( | ICollection< object > | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.RemoveSymbols | ( | params object [] | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.SetSymbols | ( | ICollection< object > | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< E >.
void com.dxfeed.api.IDXFeedSubscription< E >.SetSymbols | ( | params object [] | symbols | ) |
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. |
Implemented in com.dxfeed.api.DXFeedSubscription< 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.IDXFeedSubscription< E >.OnSubscriptionClosed |
Event calls when subscription is closing.
DXFeedSymbolsUpdateEventHandler com.dxfeed.api.IDXFeedSubscription< E >.OnSymbolsAdded |
Event calls when any symbols is added to subscription.
DXFeedSymbolsUpdateEventHandler com.dxfeed.api.IDXFeedSubscription< E >.OnSymbolsRemoved |
Event calls when any symbols is removed from subscription.