예제 #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);