public void Should_create_queue_when_connection_is_established_for_the_first_time() { queueFactory.Create(model).Returns(new QueueDeclareOk("someQueue", 1, 1)); aggregator.Notify(new ConnectionEstablished(connection)); queueFactory.Received().Create(model); }
private IQueue CreateQueue(IQueueFactory queueFactory, Uri queueUri) { var result = queueFactory.Create(queueUri); Guard.AgainstNull(result, string.Format(ESBResources.QueueFactoryCreatedNullQueue, queueFactory.GetType().FullName, queueUri)); return(result); }
public QueueDispatcher(IQueueFactory <T> queueFactory) { if (queueFactory == null) { throw new ArgumentNullException(nameof(queueFactory)); } _client = queueFactory.Create(); }
private static void Run( IQueueFactory queueFactory, IStatisticsProcesser processer, IStatisticsWriter writer) { var q = queueFactory.Create(); q.OnMessageAsync(msg => MessageProcessor.ProcessAsync(processer, writer, msg), new OnMessageOptions {AutoComplete = false}); }
public void With <T>() where T : ITaskQueue { var newQueue = queueFactory.Create <T>(queueToSwap.UserId); newQueue.InitializeFrom(queueToSwap); queues[queueToSwap.UserId] = newQueue; queueToSwap = null; }
public QueueObservable(ILogger <ManagedObservable <T> > logger, IQueueFactory <T> queueFactory) : base(logger) { if (queueFactory == null) { throw new ArgumentNullException(nameof(queueFactory)); } _queueClient = queueFactory.Create(); _queueClient.RegisterCallback(Notify); }
private IQueue CreateQueue(IQueueFactory queueFactory, Uri queueUri) { var result = queueFactory.Create(queueUri); Guard.AgainstNull(result, string.Format(ESBResources.QueueFactoryCreatedNullQueue, queueFactory.GetType().FullName, queueUri)); return result; }
/// <summary> /// Creates a pool for reusable instances /// </summary> /// <param name="capacity">The maximum number of instances to keep in the pool</param> protected ReusableObjectFactory Initialize(int capacity) { Queue = _queueFactory.Create <IReusable>(capacity); return(this); }