public Task <IListener> CreateAsync(CancellationToken cancellationToken) { var triggerExecutor = new HostMessageExecutor(_executor, _functionLookup, _functionInstanceLogger); IListener listener = _queueFactory.CreateQueueListenr(_queueName, null, triggerExecutor.ExecuteAsync); return(Task.FromResult(listener)); }
public Task <IListener> CreateAsync(CancellationToken cancellationToken) { ITriggerExecutor <IStorageQueueMessage> triggerExecutor = new HostMessageExecutor(_executor, _functionLookup, _functionInstanceLogger); // Provide an upper bound on the maximum polling interval for run/abort from dashboard. // This ensures that if users have customized this value the Dashboard will remain responsive. TimeSpan maxPollingInterval = QueuePollingIntervals.DefaultMaximum; IListener listener = new QueueListener(_queue, poisonQueue: null, triggerExecutor: triggerExecutor, exceptionHandler: _exceptionHandler, loggerFactory: _loggerFactory, sharedWatcher: null, queueConfiguration: _queueConfiguration, maxPollingInterval: maxPollingInterval); return(Task.FromResult(listener)); }
public Task <IListener> CreateAsync(IFunctionExecutor executor, CancellationToken cancellationToken) { ITriggerExecutor <IStorageQueueMessage> triggerExecutor = new HostMessageExecutor(executor, _functionLookup, _functionInstanceLogger); TimeSpan configuredMaximum = _queueConfiguration.MaxPollingInterval; // Provide an upper bound on the maximum polling interval for run/abort from dashboard. // Use the default maximum for host polling (1 minute) unless the configured overall maximum is even faster. TimeSpan maximum = configuredMaximum < DefaultMaximum ? configuredMaximum : DefaultMaximum; IDelayStrategy delayStrategy = new RandomizedExponentialBackoffStrategy(Minimum, maximum); IListener listener = new QueueListener(_queue, poisonQueue: null, triggerExecutor: triggerExecutor, delayStrategy: delayStrategy, backgroundExceptionDispatcher: _backgroundExceptionDispatcher, log: _log, sharedWatcher: null, batchSize: _queueConfiguration.BatchSize, maxDequeueCount: _queueConfiguration.MaxDequeueCount); return(Task.FromResult(listener)); }
public Task<IListener> CreateAsync(ListenerFactoryContext context) { ITriggerExecutor<IStorageQueueMessage> triggerExecutor = new HostMessageExecutor(_executor, _functionLookup, _functionInstanceLogger); TimeSpan configuredMaximum = _queueConfiguration.MaxPollingInterval; // Provide an upper bound on the maximum polling interval for run/abort from dashboard. // Use the default maximum for host polling (1 minute) unless the configured overall maximum is even faster. TimeSpan maximum = configuredMaximum < DefaultMaximum ? configuredMaximum : DefaultMaximum; IDelayStrategy delayStrategy = new RandomizedExponentialBackoffStrategy(Minimum, maximum); IListener listener = new QueueListener(_queue, poisonQueue: null, triggerExecutor: triggerExecutor, delayStrategy: delayStrategy, backgroundExceptionDispatcher: _backgroundExceptionDispatcher, log: _log, sharedWatcher: null, queueConfiguration: _queueConfiguration); return Task.FromResult(listener); }