Exemple #1
0
        public async static Task <SimpleAsyncMessageProcessingWorker <T> > CreateAndStartAsync(IQueueConsumer consumer,
                                                                                               Func <T, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout, CancellationToken cancellationToken)
        {
            var instance = new SimpleAsyncMessageProcessingWorker <T>(consumer, callbackFunc, processingTimeout);

            await instance.StartAsync(cancellationToken).ConfigureAwait(false);

            return(instance);
        }
Exemple #2
0
        public async static Task <SimpleAsyncMessageProcessingWorker <T> > CreateAndStartAsync(IQueueClient queueClient,
                                                                                               string queueName, Func <T, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout,
                                                                                               CancellationToken cancellationToken, IConsumerCountManager consumerCountManager = null,
                                                                                               IMessageRejectionHandler messageRejectionHandler = null)
        {
            var instance = new SimpleAsyncMessageProcessingWorker <T>(queueClient, queueName, callbackFunc,
                                                                      processingTimeout, consumerCountManager, messageRejectionHandler);

            await instance.StartAsync(cancellationToken).ConfigureAwait(false);

            return(instance);
        }