IMessageAdapterAsyncExtensions
Async extensions for IMessageAdapter.
Методы
ConnectAndDownloadAsync``1(IMessageAdapter, ISubscriptionMessage)
Connect, subscribe and get an async stream of messages, then disconnect on completion. This is a convenience method that handles the full lifecycle: connect -> subscribe -> disconnect.
- adapter
- IMessageAdapter
- subscription
- ISubscriptionMessage
Возвращает: Async stream of messages.
ConnectAsync(IMessageAdapter, CancellationToken) : ValueTask
Async connect for IMessageAdapter via ConnectMessage. Completes when an outgoing ConnectMessage without error is received.
- adapter
- IMessageAdapter
- cancellationToken
- CancellationToken
Возвращает: ValueTask
DisconnectAsync(IMessageAdapter, CancellationToken) : ValueTask
Async disconnect for IMessageAdapter via DisconnectMessage. Completes when an outgoing DisconnectMessage without error is received.
- adapter
- IMessageAdapter
- cancellationToken
- CancellationToken
Возвращает: ValueTask
RegisterOrderAndWaitAsync(IMessageAdapter, OrderRegisterMessage) : IAsyncEnumerable<ExecutionMessage>
Register order and get an async stream of ExecutionMessage (order state changes and own trades). When cancellation token (via .WithCancellation(token)) is canceled, the order is automatically canceled. Completes when the order reaches a final state (Done or Failed).
- adapter
- IMessageAdapter
- order
- OrderRegisterMessage to register.
Возвращает: Async stream of ExecutionMessage with order info and trades.
SubscribeAsync(IMessageAdapter, ISubscriptionMessage, CancellationToken) : ValueTask
Subscribe, wait for start/finish, and keep it active until is canceled. For historical subscriptions completes when finished, for live completes after cancellation and unsubscribe processed.
- adapter
- IMessageAdapter
- subscription
- ISubscriptionMessage
- cancellationToken
- CancellationToken
Возвращает: ValueTask
SubscribeAsync``1(IMessageAdapter, ISubscriptionMessage)
Subscribe and get an async stream of outgoing data messages of type associated with the given . Use .WithCancellation(token) to pass cancellation token.
- adapter
- IMessageAdapter
- subscription
- ISubscriptionMessage
Возвращает: Async stream of messages.