Example #1
0
        public void Subscribe(BitmexTopic topic, Func <TableResponse, Task> topicHandler)
        {
            switch (topic)
            {
            case BitmexTopic.order:
            case BitmexTopic.execution:
                _authSocket.Subscribe(topic, topicHandler);
                return;

            case BitmexTopic.orderBookL2:
            case BitmexTopic.quote:
                _openSocket.Subscribe(topic, topicHandler);
                return;

            default:
                throw new InvalidOperationException($"Unexpected topic '{topic}' on subscribe.");
            }
        }
 public void Subscribe(BitmexTopic topic, Func <TableResponse, Task> topicHandler)
 {
     _handlers[topic] = topicHandler;
 }