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
IdGeneratorTransaction id generator.
Properties
DisconnectTimeout
Disconnect timeout.
[Browsable(false)]
public virtual TimeSpan DisconnectTimeout { get; }
Property Value
FaultDelay
Delay between faulted iterations.
[Display(ResourceType = typeof(LocalizedStrings), Name = "FaultDelay", Description = "FaultDelayDesc", GroupName = "Adapters", Order = 310)]
public TimeSpan FaultDelay { get; set; }
Property Value
IsSupportPartialDownloading
Support partial downloading.
[Browsable(false)]
public override bool IsSupportPartialDownloading { get; }
Property Value
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
Methods
BoardLookupAsync(BoardLookupMessage, CancellationToken)
Process BoardLookupMessage.
public virtual ValueTask BoardLookupAsync(BoardLookupMessage lookupMsg, CancellationToken cancellationToken)
Parameters
lookupMsg
BoardLookupMessagecancellationToken
CancellationToken
Returns
CancelOrderAsync(OrderCancelMessage, CancellationToken)
Process OrderCancelMessage.
public virtual ValueTask CancelOrderAsync(OrderCancelMessage cancelMsg, CancellationToken cancellationToken)
Parameters
cancelMsg
OrderCancelMessagecancellationToken
CancellationToken
Returns
CancelOrderGroupAsync(OrderGroupCancelMessage, CancellationToken)
Process OrderGroupCancelMessage.
public virtual ValueTask CancelOrderGroupAsync(OrderGroupCancelMessage cancelMsg, CancellationToken cancellationToken)
Parameters
cancelMsg
OrderGroupCancelMessagecancellationToken
CancellationToken
Returns
ConnectAsync(ConnectMessage, CancellationToken)
Process ConnectMessage.
public virtual ValueTask ConnectAsync(ConnectMessage connectMsg, CancellationToken cancellationToken)
Parameters
connectMsg
ConnectMessagecancellationToken
CancellationToken
Returns
DisconnectAsync(DisconnectMessage, CancellationToken)
Process DisconnectMessage.
public virtual ValueTask DisconnectAsync(DisconnectMessage disconnectMsg, CancellationToken cancellationToken)
Parameters
disconnectMsg
DisconnectMessagecancellationToken
CancellationToken
Returns
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
SecurityIddataType
DataTypeData type info.
iterationInterval
TimeSpanInterval between iterations.
Returns
- TimeSpan
Step.
Load(SettingsStorage)
Load settings.
public override void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
MarketDataAsync(MarketDataMessage, CancellationToken)
Process MarketDataMessage.
public virtual ValueTask MarketDataAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnCandlesSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnCandlesSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnLevel1SubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnLevel1SubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnMarketDepthSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnMarketDepthSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnNewsSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnNewsSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnOrderLogSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnOrderLogSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnSendInMessage(Message)
Send message.
protected override bool OnSendInMessage(Message message)
Parameters
message
MessageMessage.
Returns
OnTFCandlesSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnTFCandlesSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OnTicksSubscriptionAsync(MarketDataMessage, CancellationToken)
protected virtual ValueTask OnTicksSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
Parameters
mdMsg
MarketDataMessagecancellationToken
CancellationToken
Returns
OrderStatusAsync(OrderStatusMessage, CancellationToken)
Process OrderStatusMessage.
public virtual ValueTask OrderStatusAsync(OrderStatusMessage statusMsg, CancellationToken cancellationToken)
Parameters
statusMsg
OrderStatusMessagecancellationToken
CancellationToken
Returns
PortfolioLookupAsync(PortfolioLookupMessage, CancellationToken)
Process PortfolioLookupMessage.
public virtual ValueTask PortfolioLookupAsync(PortfolioLookupMessage lookupMsg, CancellationToken cancellationToken)
Parameters
lookupMsg
PortfolioLookupMessagecancellationToken
CancellationToken
Returns
ProcessMessageAsync(Message, CancellationToken)
Process Message.
public virtual ValueTask ProcessMessageAsync(Message msg, CancellationToken cancellationToken)
Parameters
msg
MessagecancellationToken
CancellationToken
Returns
RegisterOrderAsync(OrderRegisterMessage, CancellationToken)
Process OrderRegisterMessage.
public virtual ValueTask RegisterOrderAsync(OrderRegisterMessage regMsg, CancellationToken cancellationToken)
Parameters
regMsg
OrderRegisterMessagecancellationToken
CancellationToken
Returns
ReplaceOrderAsync(OrderReplaceMessage, CancellationToken)
Process OrderReplaceMessage.
public virtual ValueTask ReplaceOrderAsync(OrderReplaceMessage replaceMsg, CancellationToken cancellationToken)
Parameters
replaceMsg
OrderReplaceMessagecancellationToken
CancellationToken
Returns
ResetAsync(ResetMessage, CancellationToken)
Process ResetMessage.
public virtual ValueTask ResetAsync(ResetMessage resetMsg, CancellationToken cancellationToken)
Parameters
resetMsg
ResetMessagecancellationToken
CancellationToken
Returns
Remarks
Must NOT throw.
Save(SettingsStorage)
Save settings.
public override void Save(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
SecurityLookupAsync(SecurityLookupMessage, CancellationToken)
Process SecurityLookupMessage.
public virtual ValueTask SecurityLookupAsync(SecurityLookupMessage lookupMsg, CancellationToken cancellationToken)
Parameters
lookupMsg
SecurityLookupMessagecancellationToken
CancellationToken
Returns
TimeAsync(TimeMessage, CancellationToken)
Process TimeMessage.
public virtual ValueTask TimeAsync(TimeMessage timeMsg, CancellationToken cancellationToken)
Parameters
timeMsg
TimeMessagecancellationToken
CancellationToken