Table of Contents

Class DXFeedSubscription

Namespace
DxFeed.Graal.Net.Api
Assembly
DxFeed.Graal.Net.dll

Subscription for a set of symbols and event types. This class is a wrapper for DxFeed.Graal.Net.Native.Subscription.SubscriptionNative. For more details see Javadoc.

public sealed class DXFeedSubscription : IObservableSubscription, IDisposable
Inheritance
DXFeedSubscription
Implements
Inherited Members

Fields

MaxBatchLimit

The maximum events' batch limit for single notification in DXFeedEventListener.

public const int MaxBatchLimit = 2147483647

Field Value

int

OptimalBatchLimit

The optimal events' batch limit for single notification in DXFeedEventListener.

public const int OptimalBatchLimit = 0

Field Value

int

Properties

AggregationPeriod

Gets or sets the aggregation period for data for this subscription instance.
Setting a new aggregation period for data 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 call to the next call to the retrieve method may take up to 5 seconds, after which the new aggregation period will take effect.

public TimeSpan AggregationPeriod { get; set; }

Property Value

TimeSpan

EventsBatchLimit

Gets or sets the maximum number of events in the single notification of DXFeedEventListener.

public int EventsBatchLimit { get; set; }

Property Value

int

IsClosed

Gets a value indicating whether if this subscription is closed. Javadoc.

public bool IsClosed { get; }

Property Value

bool

Methods

AddEventListener(DXFeedEventListener)

Adds listener for events. Event lister can be added only when subscription is not producing any events. The subscription must be either empty (no symbols have been added). This method does nothing if this subscription is closed.

public void AddEventListener(DXFeedEventListener listener)

Parameters

listener DXFeedEventListener

The event listener.

AddSymbols(IEnumerable<object>)

Adds the specified collection of symbols to the set of subscribed symbols. All registered event listeners will receive update on the last events for all newly added symbols.

public void AddSymbols(IEnumerable<object> symbols)

Parameters

symbols IEnumerable<object>

The collection of symbols.

AddSymbols(params object[])

Adds the specified collection of symbols to the set of subscribed symbols. All registered event listeners will receive update on the last events for all newly added symbols.

public void AddSymbols(params object[] symbols)

Parameters

symbols object[]

The collection of symbols.

Clear()

Clears the set of subscribed symbols.

public void Clear()

Close()

Closes this subscription and makes it permanently detached.

public void Close()

Dispose()

Releases all resources used by the current instance of the DXFeedSubscription class.

public void Dispose()

GetAggregationPeriod()

Returns the aggregation period for data for this subscription instance.

public TimeSpan GetAggregationPeriod()

Returns

TimeSpan

The aggregation period for data.

GetEventTypes()

Gets a set of subscribed event types. The resulting set cannot be modified. Javadoc.

public ISet<Type> GetEventTypes()

Returns

ISet<Type>

Returns a set of subscribed event types.

GetEventsBatchLimit()

Returns maximum number of events in the single notification of DXFeedEventListener. Special cases are supported for constants OptimalBatchLimit and MaxBatchLimit.

public int GetEventsBatchLimit()

Returns

int

The maximum number of events in the single notification.

GetSymbols()

Gets a set of subscribed symbols. 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.

public ISet<object> GetSymbols()

Returns

ISet<object>

The collection of symbols.

IsContainsEventType(Type)

Gets a value indicating whether if this subscription contains the corresponding event type. Javadoc.

public bool IsContainsEventType(Type eventType)

Parameters

eventType Type

The event type.

Returns

bool

Returns true if this subscription contains the corresponding event type.

RemoveEventListener(DXFeedEventListener)

Removes listener for events.

public void RemoveEventListener(DXFeedEventListener listener)

Parameters

listener DXFeedEventListener

The event listener.

RemoveSymbols(IEnumerable<object>)

Removes the specified collection of symbols from the set of subscribed symbols.

public void RemoveSymbols(IEnumerable<object> symbols)

Parameters

symbols IEnumerable<object>

The collection of symbols.

RemoveSymbols(params object[])

Removes the specified collection of symbols from the set of subscribed symbols.

public void RemoveSymbols(params object[] symbols)

Parameters

symbols object[]

The collection of symbols.

SetAggregationPeriod(TimeSpan)

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 call to the next call to the retrieve method may take up to 5 seconds, after which the new aggregation period will take effect.

public void SetAggregationPeriod(TimeSpan aggregationPeriod)

Parameters

aggregationPeriod TimeSpan

The new aggregation period for data.

SetEventsBatchLimit(int)

Sets maximum number of events in the single notification of DXFeedEventListener. Special cases are supported for constants OptimalBatchLimit and MaxBatchLimit.

public void SetEventsBatchLimit(int eventsBatchLimit)

Parameters

eventsBatchLimit int

The notification events limit.

Exceptions

JavaException

if eventsBatchLimit < 0 (see OptimalBatchLimit or MaxBatchLimit).

SetSymbols(IEnumerable<object>)

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(IEnumerable<object>).

public void SetSymbols(IEnumerable<object> symbols)

Parameters

symbols IEnumerable<object>

The collection of symbols.

SetSymbols(params object[])

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.

public void SetSymbols(params object[] symbols)

Parameters

symbols object[]

The collection of symbols.