public Task Listen(string route, CancellationToken token) { var queueBuilder = _builder ?? (_builder = _configurator.Build(_resolver)); var subscriber = queueBuilder.GetSubscriber(); foreach (var pair in _handlersRegistry) { subscriber.Subscribe(pair.Key, pair.Value); } var listener = queueBuilder.GetListener(); return(listener.Start(route, token)); }
public IQueuePublisher GetPublisher() { var queueBuilder = _builder ?? (_builder = _configurator.Build(_resolver)); return(queueBuilder.GetPublisher()); }