SecurityNativeIdManager
StockSharp.Algo
Security native id processing implementation.
Implements: ISecurityNativeIdManager, IDisposable
Constructors
SecurityNativeIdManager
public SecurityNativeIdManager(ILogReceiver logReceiver, INativeIdStorageProvider storageProvider, bool isNativeIdentifiersPersistable)
securityNativeIdManager = SecurityNativeIdManager(logReceiver, storageProvider, isNativeIdentifiersPersistable)
Initializes a new instance of the SecurityNativeIdManager.
- logReceiver
- Log receiver.
- storageProvider
- Security native identifier storage provider.
- isNativeIdentifiersPersistable
- Whether native identifiers are persistable.
Methods
Dispose
public void Dispose()
securityNativeIdManager.Dispose()
Disposes of items in the pool that implement IDisposable.
InitializeAsync
public ValueTask InitializeAsync(string storageName, CancellationToken cancellationToken)
result = securityNativeIdManager.InitializeAsync(storageName, cancellationToken)
Initialize from storage provider.
- storageName
- Storage name.
- cancellationToken
- Cancellation token.
ProcessInMessageAsync
public ValueTask<ValueTuple<Message[], Message[]>> ProcessInMessageAsync(Message message, CancellationToken cancellationToken)
result = securityNativeIdManager.ProcessInMessageAsync(message, cancellationToken)
Process a message going into the inner adapter.
- message
- Incoming message.
- cancellationToken
- Cancellation token.
Returns: Processing result: toInner - messages to send to inner adapter, toOut - messages to raise as output.
ProcessOutMessageAsync
public ValueTask<ValueTuple<Message, Message[], Message[]>> ProcessOutMessageAsync(Message message, CancellationToken cancellationToken)
result = securityNativeIdManager.ProcessOutMessageAsync(message, cancellationToken)
Process a message coming from the inner adapter.
- message
- Outgoing message.
- cancellationToken
- Cancellation token.
Returns: Processing result: forward - message to forward to outer, extraOut - additional messages to forward, loopbackIn - messages to send back to inner adapter.
Events
ProcessSuspendedRequested
public event Func<SecurityId, CancellationToken, ValueTask> ProcessSuspendedRequested
securityNativeIdManager.ProcessSuspendedRequested += handler
Event raised when a new native id is added from storage and suspended messages need processing.