Example #1
0
 public AbortListenerFunctionExecutor(IListenerFactory abortListenerFactory, IFunctionExecutor abortExecutor,
                                      IFunctionExecutor innerExecutor)
 {
     _abortListenerFactory = abortListenerFactory;
     _abortExecutor        = abortExecutor;
     _innerExecutor        = innerExecutor;
 }
 public HostMessageExecutor(IFunctionExecutor innerExecutor, IFunctionIndexLookup functionLookup,
                            IFunctionInstanceLogger functionInstanceLogger)
 {
     _innerExecutor          = innerExecutor;
     _functionLookup         = functionLookup;
     _functionInstanceLogger = functionInstanceLogger;
 }
        public FunctionIndexProvider(ITypeLocator typeLocator,
                                     ITriggerBindingProvider triggerBindingProvider,
                                     CompositeBindingProvider bindingProviderFactory,
                                     IJobActivator activator,
                                     IFunctionExecutor executor,
                                     IExtensionRegistry extensions,
                                     SingletonManager singletonManager,
                                     ILoggerFactory loggerFactory,
                                     SharedQueueHandler sharedQueue,
                                     IOptions <JobHostFunctionTimeoutOptions> timeoutOptions,
                                     IOptions <JobHostOptions> hostOptions)
        {
            _typeLocator            = typeLocator ?? throw new ArgumentNullException(nameof(typeLocator));
            _triggerBindingProvider = triggerBindingProvider ?? throw new ArgumentNullException(nameof(triggerBindingProvider));
            _bindingProviderFactory = bindingProviderFactory ?? throw new ArgumentNullException(nameof(bindingProviderFactory));
            _activator        = activator ?? throw new ArgumentNullException(nameof(activator));
            _executor         = executor ?? throw new ArgumentNullException(nameof(executor));
            _extensions       = extensions ?? throw new ArgumentNullException(nameof(extensions));
            _singletonManager = singletonManager ?? throw new ArgumentNullException(nameof(singletonManager));
            _sharedQueue      = sharedQueue ?? throw new ArgumentNullException(nameof(sharedQueue));

            _loggerFactory           = loggerFactory;
            _defaultTimeout          = timeoutOptions.Value.ToAttribute();
            _allowPartialHostStartup = hostOptions.Value.AllowPartialHostStartup;
        }
        public void ExecuteAsync_IfBlobIsUnchanged_CallsInnerExecutor()
        {
            // Arrange
            string                   functionId       = "FunctionId";
            string                   matchingETag     = "ETag";
            Guid                     expectedParentId = Guid.NewGuid();
            IBlobETagReader          eTagReader       = CreateStubETagReader(matchingETag);
            IBlobCausalityReader     causalityReader  = CreateStubCausalityReader(expectedParentId);
            Mock <IFunctionExecutor> mock             = new Mock <IFunctionExecutor>(MockBehavior.Strict);

            mock.Setup(e => e.TryExecuteAsync(It.Is <IFunctionInstance>(f => f.ParentId == expectedParentId),
                                              It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult <IDelayedException>(null))
            .Verifiable();
            IFunctionExecutor        innerExecutor = mock.Object;
            BlobQueueTriggerExecutor product       = CreateProductUnderTest(eTagReader, causalityReader, innerExecutor);

            product.Register(functionId, CreateFakeInstanceFactory());

            IStorageQueueMessage message = CreateMessage(functionId, matchingETag);

            // Act
            Task <bool> task = product.ExecuteAsync(message, CancellationToken.None);

            // Assert
            task.WaitUntilCompleted();
            mock.Verify();
        }
        public FunctionIndexProvider(ITypeLocator typeLocator,
                                     ITriggerBindingProvider triggerBindingProvider,
                                     IBindingProvider bindingProvider,
                                     IJobActivator activator,
                                     IFunctionExecutor executor,
                                     IExtensionRegistry extensions,
                                     SingletonManager singletonManager,
                                     TraceWriter trace,
                                     ILoggerFactory loggerFactory)
        {
            if (typeLocator == null)
            {
                throw new ArgumentNullException("typeLocator");
            }

            if (triggerBindingProvider == null)
            {
                throw new ArgumentNullException("triggerBindingProvider");
            }

            if (bindingProvider == null)
            {
                throw new ArgumentNullException("bindingProvider");
            }

            if (activator == null)
            {
                throw new ArgumentNullException("activator");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            if (extensions == null)
            {
                throw new ArgumentNullException("extensions");
            }

            if (singletonManager == null)
            {
                throw new ArgumentNullException("singletonManager");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            _typeLocator            = typeLocator;
            _triggerBindingProvider = triggerBindingProvider;
            _bindingProvider        = bindingProvider;
            _activator        = activator;
            _executor         = executor;
            _extensions       = extensions;
            _singletonManager = singletonManager;
            _trace            = trace;
            _loggerFactory    = loggerFactory;
        }
Example #6
0
 public HeartbeatFunctionExecutor(IRecurrentCommand heartbeatCommand,
                                  IBackgroundExceptionDispatcher backgroundExceptionDispatcher, IFunctionExecutor innerExecutor)
 {
     _heartbeatCommand = heartbeatCommand;
     _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
     _innerExecutor = innerExecutor;
 }
Example #7
0
        public FunctionIndexer(ITriggerBindingProvider triggerBindingProvider, IBindingProvider bindingProvider, IJobActivator activator, IFunctionExecutor executor, IExtensionRegistry extensions)
        {
            if (triggerBindingProvider == null)
            {
                throw new ArgumentNullException("triggerBindingProvider");
            }

            if (bindingProvider == null)
            {
                throw new ArgumentNullException("bindingProvider");
            }

            if (activator == null)
            {
                throw new ArgumentNullException("activator");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            if (extensions == null)
            {
                throw new ArgumentNullException("extensions");
            }

            _triggerBindingProvider = triggerBindingProvider;
            _bindingProvider        = bindingProvider;
            _activator         = activator;
            _executor          = executor;
            _jobTypeAssemblies = new HashSet <Assembly>(GetJobTypeAssemblies(extensions, typeof(ITriggerBindingProvider), typeof(IBindingProvider)));
        }
 public HeartbeatFunctionExecutor(IRecurrentCommand heartbeatCommand,
     IBackgroundExceptionDispatcher backgroundExceptionDispatcher, IFunctionExecutor innerExecutor)
 {
     _heartbeatCommand = heartbeatCommand;
     _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
     _innerExecutor = innerExecutor;
 }
        public async Task <IListener> CreateAsync(IFunctionExecutor executor, CancellationToken cancellationToken)
        {
            SharedQueueWatcher sharedQueueWatcher = _sharedContextProvider.GetOrCreate <SharedQueueWatcher>(
                new SharedQueueWatcherFactory(_messageEnqueuedWatcherSetter));
            SharedBlobListener sharedBlobListener = _sharedContextProvider.GetOrCreate <SharedBlobListener>(
                new SharedBlobListenerFactory(_account, _backgroundExceptionDispatcher, _blobWrittenWatcherSetter));

            // Note that these clients are intentionally for the storage account rather than for the dashboard account.
            // We use the storage, not dashboard, account for the blob receipt container and blob trigger queues.
            IStorageQueueClient queueClient = _account.CreateQueueClient();
            IStorageBlobClient  blobClient  = _account.CreateBlobClient();

            string hostId = await _hostIdProvider.GetHostIdAsync(cancellationToken);

            string        hostBlobTriggerQueueName = HostQueueNames.GetHostBlobTriggerQueueName(hostId);
            IStorageQueue hostBlobTriggerQueue     = queueClient.GetQueueReference(hostBlobTriggerQueueName);

            IListener blobDiscoveryToQueueMessageListener = await CreateBlobDiscoveryToQueueMessageListenerAsync(
                hostId, sharedBlobListener, blobClient, hostBlobTriggerQueue, sharedQueueWatcher, cancellationToken);

            IListener queueMessageToTriggerExecutionListener = CreateQueueMessageToTriggerExecutionListener(executor,
                                                                                                            _sharedContextProvider, sharedQueueWatcher, queueClient, hostBlobTriggerQueue, blobClient,
                                                                                                            sharedBlobListener.BlobWritterWatcher);
            IListener compositeListener = new CompositeListener(
                blobDiscoveryToQueueMessageListener,
                queueMessageToTriggerExecutionListener);

            return(compositeListener);
        }
Example #10
0
        public FunctionIndexProvider(ITypeLocator typeLocator,
                                     ITriggerBindingProvider triggerBindingProvider,
                                     IBindingProvider bindingProvider,
                                     IJobActivator activator,
                                     IFunctionExecutor executor,
                                     IExtensionRegistry extensions,
                                     SingletonManager singletonManager,
                                     ILoggerFactory loggerFactory,
                                     SharedQueueHandler sharedQueue,
                                     TimeoutAttribute defaultTimeout,
                                     bool allowPartialHostStartup = false)
        {
            _typeLocator            = typeLocator ?? throw new ArgumentNullException(nameof(typeLocator));
            _triggerBindingProvider = triggerBindingProvider ?? throw new ArgumentNullException(nameof(triggerBindingProvider));
            _bindingProvider        = bindingProvider ?? throw new ArgumentNullException(nameof(bindingProvider));
            _activator        = activator ?? throw new ArgumentNullException(nameof(activator));
            _executor         = executor ?? throw new ArgumentNullException(nameof(executor));
            _extensions       = extensions ?? throw new ArgumentNullException(nameof(extensions));
            _singletonManager = singletonManager ?? throw new ArgumentNullException(nameof(singletonManager));
            _sharedQueue      = sharedQueue ?? throw new ArgumentNullException(nameof(sharedQueue));

            _loggerFactory           = loggerFactory;
            _defaultTimeout          = defaultTimeout;
            _allowPartialHostStartup = allowPartialHostStartup;
        }
 public HeartbeatFunctionExecutor(IRecurrentCommand heartbeatCommand,
                                  IWebJobsExceptionHandler exceptionHandler, IFunctionExecutor innerExecutor)
 {
     _heartbeatCommand = heartbeatCommand;
     _exceptionHandler = exceptionHandler;
     _innerExecutor    = innerExecutor;
 }
Example #12
0
 public DisableLegacyLogger(
     IFunctionExecutor functionExecutor,
     SharedQueueHandler sharedQueueHandler
     )
 {
     this._functionExecutor   = functionExecutor;
     this._sharedQueueHandler = sharedQueueHandler;
 }
        private static BlobQueueTriggerExecutor CreateProductUnderTest(IBlobETagReader eTagReader,
                                                                       IBlobWrittenWatcher blobWrittenWatcher)
        {
            IBlobCausalityReader causalityReader = CreateDummyCausalityReader();
            IFunctionExecutor    innerExecutor   = CreateDummyInnerExecutor();

            return(CreateProductUnderTest(eTagReader, causalityReader, innerExecutor, blobWrittenWatcher));
        }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessingManager"/> class.
 /// </summary>
 /// <param name="storage">The point storage.</param>
 /// <param name="functionExecutor">The function executor.</param>
 public ProcessingManager(IStorage storage, IFunctionExecutor functionExecutor)
 {
     this.storage          = storage;
     this.functionExecutor = functionExecutor;
     this.alarmProcessor   = new AlarmProcessor();
     this.eguConverter     = new EGUConverter();
     this.functionExecutor.UpdatePointEvent += CommandExecutor_UpdatePointEvent;
 }
        public FunctionIndexProvider(ITypeLocator typeLocator,
            ITriggerBindingProvider triggerBindingProvider,
            IBindingProvider bindingProvider,
            IJobActivator activator,
            IFunctionExecutor executor,
            IExtensionRegistry extensions,
            SingletonManager singletonManager,
            TraceWriter trace)
        {
            if (typeLocator == null)
            {
                throw new ArgumentNullException("typeLocator");
            }

            if (triggerBindingProvider == null)
            {
                throw new ArgumentNullException("triggerBindingProvider");
            }

            if (bindingProvider == null)
            {
                throw new ArgumentNullException("bindingProvider");
            }

            if (activator == null)
            {
                throw new ArgumentNullException("activator");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            if (extensions == null)
            {
                throw new ArgumentNullException("extensions");
            }

            if (singletonManager == null)
            {
                throw new ArgumentNullException("singletonManager");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            _typeLocator = typeLocator;
            _triggerBindingProvider = triggerBindingProvider;
            _bindingProvider = bindingProvider;
            _activator = activator;
            _executor = executor;
            _extensions = extensions;
            _singletonManager = singletonManager;
            _trace = trace;
        }
Example #16
0
 public ProcessingManager(IFunctionExecutor functionExecutor)
 {
     this.functionExecutor = functionExecutor;
     applicationSequence   = 0;
     transportSequence     = 0;
     dom     = ScadaProxyFactory.Instance().DOMProxy();
     log     = ScadaProxyFactory.Instance().LoggingProxy();
     storage = ScadaProxyFactory.Instance().ScadaStorageProxy();
 }
Example #17
0
 public ProcessingManager(IFunctionExecutor functionExecutor)
 {
     this.functionExecutor = functionExecutor;
     applicationSequence   = 0;
     transportSequence     = 0;
     dom     = new DomServiceProxy(ConfigurationManager.AppSettings["Dom"]);
     log     = new LogServiceProxy(ConfigurationManager.AppSettings["Log"]);
     storage = new SF.Common.Proxies.ScadaStorageProxy(ConfigurationManager.AppSettings["Storage"]);
 }
Example #18
0
        public FunctionIndexer(
            ITriggerBindingProvider triggerBindingProvider,
            IBindingProvider bindingProvider,
            IJobActivator activator,
            IFunctionExecutor executor,
            IExtensionRegistry extensions,
            SingletonManager singletonManager,
            TraceWriter trace,
            ILoggerFactory loggerFactory,
            INameResolver nameResolver = null)
        {
            if (triggerBindingProvider == null)
            {
                throw new ArgumentNullException("triggerBindingProvider");
            }

            if (bindingProvider == null)
            {
                throw new ArgumentNullException("bindingProvider");
            }

            if (activator == null)
            {
                throw new ArgumentNullException("activator");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            if (extensions == null)
            {
                throw new ArgumentNullException("extensions");
            }

            if (singletonManager == null)
            {
                throw new ArgumentNullException("singletonManager");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            _triggerBindingProvider = triggerBindingProvider;
            _bindingProvider        = bindingProvider;
            _activator              = activator;
            _executor               = executor;
            _singletonManager       = singletonManager;
            _jobAttributeAssemblies = GetJobAttributeAssemblies(extensions);
            _nameResolver           = nameResolver;
            _trace  = trace;
            _logger = loggerFactory?.CreateLogger(LogCategories.Startup);
        }
Example #19
0
 public JobHostContext(IFunctionIndexLookup functionLookup,
                       IFunctionExecutor executor,
                       IListener listener,
                       TraceWriter trace)
 {
     _functionLookup = functionLookup;
     _executor       = executor;
     _listener       = listener;
     _trace          = trace;
 }
Example #20
0
 public void Start()
 {
     if (!started)
     {
         functionExecutor  = new FunctionExecutor();
         processingManager = new ProcessingManager(functionExecutor);
         acquisitor        = new Acquisitor(processingManager);
         started           = true;
     }
 }
 public JobHostContext(IFunctionIndexLookup functionLookup,
                       IFunctionExecutor executor,
                       IListener listener,
                       TextWriter log)
 {
     _functionLookup = functionLookup;
     _executor       = executor;
     _listener       = listener;
     _log            = log;
 }
 public JobHostContext(IFunctionIndexLookup functionLookup,
     IFunctionExecutor executor,
     IListener listener,
     TraceWriter trace)
 {
     _functionLookup = functionLookup;
     _executor = executor;
     _listener = listener;
     _trace = trace;
 }
Example #23
0
        public LineProcessor(IFunctionExecutor functionExecutor)
        {
            if (functionExecutor == null)
            {
                throw new ArgumentNullException();
            }

            this.target           = functionExecutor.Target;
            this.functionExecutor = functionExecutor;
        }
Example #24
0
        public FunctionIndexer(
            ITriggerBindingProvider triggerBindingProvider,
            IBindingProvider bindingProvider,
            IJobActivator activator,
            IFunctionExecutor executor,
            IExtensionRegistry extensions,
            SingletonManager singletonManager,
            ILoggerFactory loggerFactory,
            INameResolver nameResolver      = null,
            SharedQueueHandler sharedQueue  = null,
            TimeoutAttribute defaultTimeout = null,
            bool allowPartialHostStartup    = false)
        {
            if (triggerBindingProvider == null)
            {
                throw new ArgumentNullException("triggerBindingProvider");
            }

            if (bindingProvider == null)
            {
                throw new ArgumentNullException("bindingProvider");
            }

            if (activator == null)
            {
                throw new ArgumentNullException("activator");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            if (extensions == null)
            {
                throw new ArgumentNullException("extensions");
            }

            if (singletonManager == null)
            {
                throw new ArgumentNullException("singletonManager");
            }

            _triggerBindingProvider = triggerBindingProvider;
            _bindingProvider        = bindingProvider;
            _activator              = activator;
            _executor               = executor;
            _singletonManager       = singletonManager;
            _jobAttributeAssemblies = GetJobAttributeAssemblies(extensions);
            _nameResolver           = nameResolver;
            _logger                  = loggerFactory?.CreateLogger(LogCategories.Startup);
            _sharedQueue             = sharedQueue;
            _defaultTimeout          = defaultTimeout;
            _allowPartialHostStartup = allowPartialHostStartup;
        }
Example #25
0
 public FEP()
 {
     if (!started)
     {
         functionExecutor  = new FunctionExecutor();
         processingManager = new ProcessingManager(functionExecutor);
         acquisitor        = new Acquisitor(processingManager);
         commandingService = new CommandingService(processingManager);
         started           = true;
     }
 }
        private static IListener CreateHostListener(IListenerFactory allFunctionsListenerFactory,
                                                    IRecurrentCommand heartbeatCommand, IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
                                                    CancellationToken shutdownToken, IFunctionExecutor executor)
        {
            IListener factoryListener   = new ListenerFactoryListener(allFunctionsListenerFactory, executor);
            IListener heartbeatListener = new HeartbeatListener(heartbeatCommand,
                                                                backgroundExceptionDispatcher, factoryListener);
            IListener shutdownListener = new ShutdownListener(shutdownToken, heartbeatListener);

            return(shutdownListener);
        }
 public BlobQueueTriggerExecutor(IStorageBlobClient client, IBlobETagReader eTagReader,
                                 IBlobCausalityReader causalityReader, IFunctionExecutor innerExecutor,
                                 IBlobWrittenWatcher blobWrittenWatcher)
 {
     _client             = client;
     _eTagReader         = eTagReader;
     _causalityReader    = causalityReader;
     _innerExecutor      = innerExecutor;
     _blobWrittenWatcher = blobWrittenWatcher;
     _registrations      = new ConcurrentDictionary <string, ITriggeredFunctionInstanceFactory <IStorageBlob> >();
 }
Example #28
0
        private static FunctionDefinition CreateTriggeredFunctionDefinitionImpl <TTriggerValue>(
            ITriggerBinding triggerBinding, string parameterName, IFunctionExecutor executor, FunctionDescriptor descriptor,
            IReadOnlyDictionary <string, IBinding> nonTriggerBindings, IFunctionInvoker invoker, SingletonManager singletonManager)
        {
            ITriggeredFunctionBinding <TTriggerValue>         functionBinding = new TriggeredFunctionBinding <TTriggerValue>(descriptor, parameterName, triggerBinding, nonTriggerBindings, singletonManager);
            ITriggeredFunctionInstanceFactory <TTriggerValue> instanceFactory = new TriggeredFunctionInstanceFactory <TTriggerValue>(functionBinding, invoker, descriptor);
            ITriggeredFunctionExecutor triggerExecutor = new TriggeredFunctionExecutor <TTriggerValue>(descriptor, executor, instanceFactory);
            IListenerFactory           listenerFactory = new ListenerFactory(descriptor, triggerExecutor, triggerBinding);

            return(new FunctionDefinition(descriptor, instanceFactory, listenerFactory));
        }
        public HostMessageListenerFactory(IStorageQueue queue,
                                          IQueueConfiguration queueConfiguration,
                                          IWebJobsExceptionHandler exceptionHandler,
                                          TraceWriter trace,
                                          ILoggerFactory loggerFactory,
                                          IFunctionIndexLookup functionLookup,
                                          IFunctionInstanceLogger functionInstanceLogger,
                                          IFunctionExecutor executor)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (exceptionHandler == null)
            {
                throw new ArgumentNullException("exceptionHandler");
            }

            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            if (functionLookup == null)
            {
                throw new ArgumentNullException("functionLookup");
            }

            if (functionInstanceLogger == null)
            {
                throw new ArgumentNullException("functionInstanceLogger");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            _queue = queue;
            _queueConfiguration = queueConfiguration;
            _exceptionHandler   = exceptionHandler;
            _trace                  = trace;
            _loggerFactory          = loggerFactory;
            _functionLookup         = functionLookup;
            _functionInstanceLogger = functionInstanceLogger;
            _executor               = executor;
        }
 public JobHostContext(IFunctionIndexLookup functionLookup,
                       IFunctionExecutor executor,
                       IListener listener,
                       IAsyncCollector <FunctionInstanceLogEntry> eventCollector,
                       ILoggerFactory loggerFactory = null)
 {
     _functionLookup = functionLookup;
     _executor       = executor;
     _listener       = listener;
     _eventCollector = eventCollector;
     _loggerFactory  = loggerFactory;
 }
 public JobHostContext(IFunctionIndexLookup functionLookup,
     IFunctionExecutor executor,
     IListener listener,
     TraceWriter trace,
     IAsyncCollector<FunctionInstanceLogEntry> fastLogger = null)
 {
     _functionLookup = functionLookup;
     _executor = executor;
     _listener = listener;
     _trace = trace;
     _fastLogger = fastLogger;
 }
        public async Task <IListener> CreateAsync(IFunctionExecutor executor, CancellationToken cancellationToken)
        {
            // Must create all messaging entities before creating message receivers and calling OnMessage.
            // Otherwise, some function could start to execute and try to output messages to entities that don't yet
            // exist.
            await _namespaceManager.CreateQueueIfNotExistsAsync(_queueName, cancellationToken);

            ITriggerExecutor <BrokeredMessage> triggerExecutor = new ServiceBusTriggerExecutor(_instanceFactory,
                                                                                               executor);

            return(new ServiceBusListener(_messagingFactory, _queueName, triggerExecutor));
        }
 public JobHostContext(IFunctionIndexLookup functionLookup,
                       IFunctionExecutor executor,
                       IListener listener,
                       TraceWriter trace,
                       IAsyncCollector <FunctionInstanceLogEntry> fastLogger = null)
 {
     _functionLookup = functionLookup;
     _executor       = executor;
     _listener       = listener;
     _trace          = trace;
     _fastLogger     = fastLogger;
 }
Example #34
0
 public DComCore()
 {
     configuration          = new ConfigReader();
     commandExecutor        = new FunctionExecutor(this, configuration);
     this.processingManager = new ProcessingManager(this, commandExecutor);
     this.acquisitor        = new Acquisitor(acquisitionTrigger, this.processingManager, this, configuration);
     this.automationManager = new AutomationManager(this, processingManager, automationTrigger, configuration);
     InitializePointCollection();
     InitializeAndStartThreads();
     logBuilder = new StringBuilder();
     Thread.CurrentThread.Name = "Main Thread";
 }
        public HostMessageListenerFactory(IStorageQueue queue,
            IQueueConfiguration queueConfiguration,
            IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
            TextWriter log,
            IFunctionIndexLookup functionLookup,
            IFunctionInstanceLogger functionInstanceLogger,
            IFunctionExecutor executor)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (backgroundExceptionDispatcher == null)
            {
                throw new ArgumentNullException("backgroundExceptionDispatcher");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            if (functionLookup == null)
            {
                throw new ArgumentNullException("functionLookup");
            }

            if (functionInstanceLogger == null)
            {
                throw new ArgumentNullException("functionInstanceLogger");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            _queue = queue;
            _queueConfiguration = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _log = log;
            _functionLookup = functionLookup;
            _functionInstanceLogger = functionInstanceLogger;
            _executor = executor;
        }
 private static IFunctionExecutor CreateHostCallExecutor(IListenerFactory instanceQueueListenerFactory,
     IRecurrentCommand heartbeatCommand, IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
     CancellationToken shutdownToken, IFunctionExecutor innerExecutor)
 {
     IFunctionExecutor heartbeatExecutor = new HeartbeatFunctionExecutor(heartbeatCommand,
         backgroundExceptionDispatcher, innerExecutor);
     IFunctionExecutor abortListenerExecutor = new AbortListenerFunctionExecutor(instanceQueueListenerFactory, heartbeatExecutor);
     IFunctionExecutor shutdownFunctionExecutor = new ShutdownFunctionExecutor(shutdownToken, abortListenerExecutor);
     return shutdownFunctionExecutor;
 }
 public ShutdownFunctionExecutor(CancellationToken shutdownToken, IFunctionExecutor innerExecutor)
 {
     _shutdownToken = shutdownToken;
     _innerExecutor = innerExecutor;
 }
 public AbortListenerFunctionExecutor(IListenerFactory abortListenerFactory, IFunctionExecutor innerExecutor)
 {
     _abortListenerFactory = abortListenerFactory;
     _innerExecutor = innerExecutor;
 }