Table of Contents

Class AsyncConnector<TPortfolioKey, TSecurityKey>.ConnectorSynchronizationContext

Namespace
ATAS.DataFeedsCore
Assembly
ATAS.DataFeedsCore.dll

Custom synchronization context to forward await continuations to the connector queue

public class AsyncConnector<TPortfolioKey, TSecurityKey>.ConnectorSynchronizationContext : SynchronizationContext
Inheritance
object
SynchronizationContext
AsyncConnector<TPortfolioKey, TSecurityKey>.ConnectorSynchronizationContext
Extension Methods

Constructors

ConnectorSynchronizationContext(AsyncConnector<TPortfolioKey, TSecurityKey>)

Initializes the context of a connector.

public ConnectorSynchronizationContext(AsyncConnector<TPortfolioKey, TSecurityKey> connector)

Parameters

connector AsyncConnector<TPortfolioKey, TSecurityKey>

The connector whose queue runs the callbacks.

Exceptions

ArgumentNullException

connector is null.

Methods

CreateCopy()

Creates a new context of the same connector.

public override SynchronizationContext CreateCopy()

Returns

SynchronizationContext

The copy.

Post(SendOrPostCallback, object?)

Queues the callback as an await continuation of the connector's thread and returns at once. The callback is dropped instead of run if the connection session it was posted in ends first (see EnqueueContinuation(IDataFeedConnector, Action)).

Added in ATAS 8.0.15.

public override void Post(SendOrPostCallback d, object? state)

Parameters

d SendOrPostCallback

The callback.

state object

The state passed to the callback.

Send(SendOrPostCallback, object?)

Queues the callback as a message of the connector and blocks the calling thread until the connector's thread has run it. Must not be called on the connector's thread: it would wait for itself.

Added in ATAS 8.0.15.

public override void Send(SendOrPostCallback d, object? state)

Parameters

d SendOrPostCallback

The callback.

state object

The state passed to the callback.