Пример #1
0
        /// <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));
        }
Пример #2
0
 /// <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);
Пример #3
0
 /// <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);
Пример #4
0
 /// <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);
Пример #5
0
 /// <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);
Пример #6
0
 /// <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);
Пример #7
0
 /// <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);