/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <param name="limit"></param> /// <param name="callback"></param> /// <param name="token"></param> /// <returns></returns> public static Task SubscribeAndStreamAsync(this ITradeCache cache, string symbol, int limit, Action <TradeCacheEventArgs> callback, CancellationToken token) { Throw.IfNull(cache, nameof(cache)); cache.Subscribe(symbol, limit, callback); return(StreamAsync(cache, token)); }
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <param name="callback"></param> /// <returns></returns> public static void Subscribe <TClient>(this ITradeCache <TClient> cache, string symbol, Action <TradeCacheEventArgs> callback) where TClient : ITradeClient => cache.Subscribe(symbol, default, callback);
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <param name="limit"></param> /// <returns></returns> public static void Subscribe <TClient>(this ITradeCache <TClient> cache, string symbol, int limit) where TClient : ITradeClient => cache.Subscribe(symbol, limit, null);
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <returns></returns> public static void Subscribe <TClient>(this ITradeCache <TClient> cache, string symbol) where TClient : ITradeClient => cache.Subscribe(symbol, default, null);
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <param name="callback"></param> /// <returns></returns> public static void Subscribe(this ITradeCache cache, string symbol, Action <TradeCacheEventArgs> callback) => cache.Subscribe(symbol, default, callback);
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <param name="limit"></param> /// <returns></returns> public static void Subscribe(this ITradeCache cache, string symbol, int limit) => cache.Subscribe(symbol, limit, null);
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="symbol"></param> /// <returns></returns> public static void Subscribe(this ITradeCache cache, string symbol) => cache.Subscribe(symbol, default, null);