Table of Contents

Class AsyncMessageAdapter

Namespace
StockSharp.Messages
Assembly
StockSharp.Messages.dll

Message adapter with async processing support.

public abstract class AsyncMessageAdapter : MessageAdapter, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanged
Inheritance
AsyncMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Derived
Inherited Members
Extension Methods

Constructors

AsyncMessageAdapter(IdGenerator)

Initialize AsyncMessageAdapter.

protected AsyncMessageAdapter(IdGenerator transactionIdGenerator)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

Properties

DisconnectTimeout

Disconnect timeout.

[Browsable(false)]
public virtual TimeSpan DisconnectTimeout { get; }

Property Value

TimeSpan

FaultDelay

Delay between faulted iterations.

[Display(ResourceType = typeof(LocalizedStrings), Name = "FaultDelay", Description = "FaultDelayDesc", GroupName = "Adapters", Order = 310)]
public TimeSpan FaultDelay { get; set; }

Property Value

TimeSpan

IsSupportPartialDownloading

Support partial downloading.

[Browsable(false)]
public override bool IsSupportPartialDownloading { get; }

Property Value

bool

MaxParallelMessages

Max number of parallel (non-control) messages processing.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Parallel", Description = "ParallelDesc", GroupName = "Adapters", Order = 310)]
public int MaxParallelMessages { get; set; }

Property Value

int

Methods

BoardLookupAsync(BoardLookupMessage, CancellationToken)

public virtual ValueTask BoardLookupAsync(BoardLookupMessage lookupMsg, CancellationToken cancellationToken)

Parameters

lookupMsg BoardLookupMessage

BoardLookupMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

CancelOrderAsync(OrderCancelMessage, CancellationToken)

public virtual ValueTask CancelOrderAsync(OrderCancelMessage cancelMsg, CancellationToken cancellationToken)

Parameters

cancelMsg OrderCancelMessage

OrderCancelMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

CancelOrderGroupAsync(OrderGroupCancelMessage, CancellationToken)

public virtual ValueTask CancelOrderGroupAsync(OrderGroupCancelMessage cancelMsg, CancellationToken cancellationToken)

Parameters

cancelMsg OrderGroupCancelMessage

OrderGroupCancelMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

ConnectAsync(ConnectMessage, CancellationToken)

Process ConnectMessage.

public virtual ValueTask ConnectAsync(ConnectMessage connectMsg, CancellationToken cancellationToken)

Parameters

connectMsg ConnectMessage

ConnectMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

DisconnectAsync(DisconnectMessage, CancellationToken)

public virtual ValueTask DisconnectAsync(DisconnectMessage disconnectMsg, CancellationToken cancellationToken)

Parameters

disconnectMsg DisconnectMessage

DisconnectMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

DisposeManaged()

protected override void DisposeManaged()

GetHistoryStepSize(SecurityId, DataType, out TimeSpan)

Get maximum size step allowed for historical download.

public override TimeSpan GetHistoryStepSize(SecurityId securityId, DataType dataType, out TimeSpan iterationInterval)

Parameters

securityId SecurityId

SecurityId

dataType DataType

Data type info.

iterationInterval TimeSpan

Interval between iterations.

Returns

TimeSpan

Step.

Load(SettingsStorage)

Load settings.

public override void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

MarketDataAsync(MarketDataMessage, CancellationToken)

public virtual ValueTask MarketDataAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage

MarketDataMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

OnCandlesSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnCandlesSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnLevel1SubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnLevel1SubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnMarketDepthSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnMarketDepthSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnNewsSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnNewsSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnOrderLogSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnOrderLogSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnSendInMessage(Message)

Send message.

protected override bool OnSendInMessage(Message message)

Parameters

message Message

Message.

Returns

bool

true if the specified message was processed successfully, otherwise, false.

OnTFCandlesSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnTFCandlesSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnTicksSubscriptionAsync(MarketDataMessage, CancellationToken)

protected virtual ValueTask OnTicksSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OrderStatusAsync(OrderStatusMessage, CancellationToken)

public virtual ValueTask OrderStatusAsync(OrderStatusMessage statusMsg, CancellationToken cancellationToken)

Parameters

statusMsg OrderStatusMessage

OrderStatusMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

PortfolioLookupAsync(PortfolioLookupMessage, CancellationToken)

public virtual ValueTask PortfolioLookupAsync(PortfolioLookupMessage lookupMsg, CancellationToken cancellationToken)

Parameters

lookupMsg PortfolioLookupMessage

PortfolioLookupMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

ProcessMessageAsync(Message, CancellationToken)

Process Message.

public virtual ValueTask ProcessMessageAsync(Message msg, CancellationToken cancellationToken)

Parameters

msg Message

Message.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

RegisterOrderAsync(OrderRegisterMessage, CancellationToken)

public virtual ValueTask RegisterOrderAsync(OrderRegisterMessage regMsg, CancellationToken cancellationToken)

Parameters

regMsg OrderRegisterMessage

OrderRegisterMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

ReplaceOrderAsync(OrderReplaceMessage, CancellationToken)

public virtual ValueTask ReplaceOrderAsync(OrderReplaceMessage replaceMsg, CancellationToken cancellationToken)

Parameters

replaceMsg OrderReplaceMessage

OrderReplaceMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

ResetAsync(ResetMessage, CancellationToken)

Process ResetMessage.

public virtual ValueTask ResetAsync(ResetMessage resetMsg, CancellationToken cancellationToken)

Parameters

resetMsg ResetMessage

ResetMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

Remarks

Must NOT throw.

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

SecurityLookupAsync(SecurityLookupMessage, CancellationToken)

public virtual ValueTask SecurityLookupAsync(SecurityLookupMessage lookupMsg, CancellationToken cancellationToken)

Parameters

lookupMsg SecurityLookupMessage

SecurityLookupMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

TimeAsync(TimeMessage, CancellationToken)

Process TimeMessage.

public virtual ValueTask TimeAsync(TimeMessage timeMsg, CancellationToken cancellationToken)

Parameters

timeMsg TimeMessage

TimeMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.