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
-
objectSynchronizationContextAsyncConnector<TPortfolioKey, TSecurityKey>.ConnectorSynchronizationContext
- Extension Methods
Constructors
ConnectorSynchronizationContext(AsyncConnector<TPortfolioKey, TSecurityKey>)
Initializes the context of a connector.
public ConnectorSynchronizationContext(AsyncConnector<TPortfolioKey, TSecurityKey> connector)
Parameters
connectorAsyncConnector<TPortfolioKey, TSecurityKey>The connector whose queue runs the callbacks.
Exceptions
- ArgumentNullException
connectoris 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
dSendOrPostCallbackThe callback.
stateobjectThe 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
dSendOrPostCallbackThe callback.
stateobjectThe state passed to the callback.