public AdvancedMessageProcessingWorker(IQueueClient queueClient, string queueName, Action <T> callbackAction,
                                        ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue,
                                        int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0,
                                        ConsumerCountManager consumerCountManager = null, IMessageRejectionHandler messageRejectionHandler = null)
     : base(queueClient, queueName, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds,
            consumerCountManager, messageRejectionHandler)
 {
     _callbackAction = callbackAction;
 }
예제 #2
0
 protected AbstractAdvancedMessageProcessingWorker(IQueueClient queueClient, string queueName,
                                                   ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue,
                                                   int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0,
                                                   ConsumerCountManager consumerCountManager = null, IMessageRejectionHandler messageRejectionHandler = null)
     : base(queueClient, queueName, consumerCountManager, messageRejectionHandler)
 {
     InvokeRetryCount            = invokeRetryCount;
     InvokeRetryWaitMilliseconds = invokeRetryWaitMilliseconds;
     ExceptionHandlingStrategy   = exceptionHandlingStrategy;
 }
 public AdvancedAsyncMessageProcessingWorker(IQueueClient queueClient, string queueName,
                                             Func <T, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout,
                                             ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue,
                                             int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0,
                                             ConsumerCountManager consumerCountManager = null, IMessageRejectionHandler messageRejectionHandler = null)
     : base(queueClient, queueName, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds,
            consumerCountManager, messageRejectionHandler)
 {
     _callbackFunc      = callbackFunc;
     _processingTimeout = processingTimeout;
 }
        public async static Task <AdvancedMessageProcessingWorker <T> > CreateAndStartAsync(IQueueClient queueClient,
                                                                                            string queueName, Action <T> callbackAction, CancellationToken cancellationToken,
                                                                                            ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue,
                                                                                            int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0,
                                                                                            ConsumerCountManager consumerCountManager = null, IMessageRejectionHandler messageRejectionHandler = null)
        {
            var instance = new AdvancedMessageProcessingWorker <T>(queueClient, queueName, callbackAction,
                                                                   exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, consumerCountManager,
                                                                   messageRejectionHandler);

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

            return(instance);
        }