/// <summary>
            /// Subscribe to all market summaries
            /// </summary>
            /// <param name="callback">Callback</param>
            /// <param name="marketSymbols">Symbols</param>
            /// <returns>IDisposable to close the socket</returns>
            public async Task <IWebSocket> SubscribeToSummaryDeltasAsync(Func <string, Task> callback, params string[] marketSymbols)
            {
                SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
                await conn.OpenAsync("uS", callback);

                return(conn);
            }
 /// <summary>
 /// Subscribe to all market summaries
 /// </summary>
 /// <param name="callback">Callback</param>
 /// <returns>IDisposable to close the socket</returns>
 public IWebSocket SubscribeToSummaryDeltas(Action <string> callback)
 {
     SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
     Task.Run(async() => await conn.OpenAsync("uS", (s) =>
     {
         callback(s);
         return(Task.CompletedTask);
     }));
     return(conn);
 }
            /// <summary>
            /// Subscribe to order book updates
            /// </summary>
            /// <param name="callback">Callback</param>
            /// <param name="symbols">The ticker to subscribe to</param>
            /// <returns>IDisposable to close the socket</returns>
            public IWebSocket SubscribeToExchangeDeltas(Action <string> callback, params string[] symbols)
            {
                SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
                List <object[]> paramList = new List <object[]>();

                foreach (string symbol in symbols)
                {
                    paramList.Add(new object[] { symbol });
                }
                Task.Run(() => conn.OpenAsync("uE", callback, 0, paramList.ToArray()));
                return(conn);
            }
Ejemplo n.º 4
0
            /// <summary>
            /// Subscribe to order book updates
            /// </summary>
            /// <param name="callback">Callback</param>
            /// <param name="symbols">The ticker to subscribe to</param>
            /// <returns>IDisposable to close the socket</returns>
            public IWebSocket SubscribeToExchangeDeltas(Action <string> callback, params string[] symbols)
            {
                SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection();
                List <string[]> paramList = new List <string[]>();

                foreach (string symbol in symbols)
                {
                    paramList.Add(new string[] { symbol });
                }
                conn.OpenAsync(this, "uE", callback, paramList.ToArray()).ConfigureAwait(false).GetAwaiter().GetResult();
                return(conn);
            }
            /// <summary>
            /// Subscribe to order book updates
            /// </summary>
            /// <param name="callback">Callback</param>
            /// <param name="marketSymbols">The market symbols to subscribe to</param>
            /// <returns>IDisposable to close the socket</returns>
            public async Task <IWebSocket> SubscribeToExchangeDeltasAsync(Func <string, Task> callback, params string[] marketSymbols)
            {
                SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
                List <object[]> paramList = new List <object[]>();

                foreach (string marketSymbol in marketSymbols)
                {
                    paramList.Add(new object[] { marketSymbol });
                }
                await conn.OpenAsync("uE", callback, 0, paramList.ToArray());

                return(conn);
            }
            /// <summary>
            /// Subscribe to order book updates
            /// </summary>
            /// <param name="callback">Callback</param>
            /// <param name="marketSymbols">The market symbols to subscribe to</param>
            /// <returns>IDisposable to close the socket</returns>
            public IWebSocket SubscribeToExchangeDeltas(Action <string> callback, params string[] marketSymbols)
            {
                SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
                List <object[]> paramList = new List <object[]>();

                foreach (string marketSymbol in marketSymbols)
                {
                    paramList.Add(new object[] { marketSymbol });
                }
                Task.Run(async() => await conn.OpenAsync("uE", (s) =>
                {
                    callback(s);
                    return(Task.CompletedTask);
                }, 0, paramList.ToArray()));
                return(conn);
            }
Ejemplo n.º 7
0
 /// <summary>
 /// Subscribe to order book updates
 /// </summary>
 /// <param name="callback">Callback</param>
 /// <param name="ticker">The ticker to subscribe to</param>
 /// <returns>IDisposable to close the socket</returns>
 public IDisposable SubscribeToExchangeDeltas(Action <string> callback, string ticker)
 {
     SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection();
     conn.OpenAsync(this, "uE", callback, ticker).ConfigureAwait(false).GetAwaiter().GetResult();
     return(conn);
 }
 /// <summary>
 /// Subscribe to all market summaries
 /// </summary>
 /// <param name="callback">Callback</param>
 /// <returns>IDisposable to close the socket</returns>
 public IWebSocket SubscribeToSummaryDeltas(Action <string> callback)
 {
     SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection(this);
     Task.Run(() => conn.OpenAsync("uS", callback));
     return(conn);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Subscribe to all market summaries
 /// </summary>
 /// <param name="callback">Callback</param>
 /// <returns>IDisposable to close the socket</returns>
 public IWebSocket SubscribeToSummaryDeltas(Action <string> callback)
 {
     SignalrManager.SignalrSocketConnection conn = new SignalrManager.SignalrSocketConnection();
     conn.OpenAsync(this, "uS", callback).ConfigureAwait(false).GetAwaiter().GetResult();
     return(conn);
 }