Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public IQueuePublisher GetPublisher()
        {
            var queueBuilder = _builder ?? (_builder = _configurator.Build(_resolver));

            return(queueBuilder.GetPublisher());
        }