Table of Contents

Method GetNewerTickerAsync

Namespace
WhalesSecret.TradeScriptLib.API.TradingV1.MarketData
Assembly
WhalesSecret.TradeScriptLib.dll

GetNewerTickerAsync(CancellationToken)

Gets a newer ticker than the last one previously returned by this method or by GetLatestTicker(). If no such ticker is available, the method waits until a new ticker update arrives.

Task<Ticker> GetNewerTickerAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token that allows the caller to cancel the operation.

Returns

Task<Ticker>

Up-to-date ticker.

Remarks

This method is useful, for example, if one wants to get a ticker every N seconds.

The method is not suitable to give you all ticker updates.

Exceptions

OperationCanceledException

Thrown if the operation was cancelled, including cancellation during the shutdown.

NotFoundException

Thrown if the method is called after the ticker subscription was disposed.

NotConnectedTimeoutException

Thrown if the connection strategy associated with this instance is BlockUntilReconnectedOrTimeout with non-infinite timeout value and this timeout expired while the connection to the exchange is interrupted. That is, this exception does not limit the request itself, it rather limits the period of time that allows the client to recover from the interruption of the connection to the exchange.

NotConnectedException

Thrown if the connection strategy is FailInstantlyIfNotConnected and the connection to the exchange is interrupted.