예제 #1
0
 public ServiceBusSubscriptionListenerFactory(ServiceBusAccount account, string topicName,
                                              string subscriptionName, ITriggeredFunctionInstanceFactory <BrokeredMessage> instanceFactory)
 {
     _namespaceManager = account.NamespaceManager;
     _messagingFactory = account.MessagingFactory;
     _topicName        = topicName;
     _subscriptionName = subscriptionName;
     _instanceFactory  = instanceFactory;
 }
        public void Register(string functionId, ITriggeredFunctionInstanceFactory <IStorageBlob> instanceFactory)
        {
            if (_started)
            {
                throw new InvalidOperationException(
                          "Registrations may not be added while the shared listener is running.");
            }

            _executor.Register(functionId, instanceFactory);
        }
        public QueueListenerFactory(IStorageQueue queue,
                                    IQueueConfiguration queueConfiguration,
                                    IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
                                    IContextSetter <IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
                                    ISharedContextProvider sharedContextProvider,
                                    TextWriter log,
                                    ITriggeredFunctionInstanceFactory <IStorageQueueMessage> instanceFactory)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

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

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

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

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

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

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

            _queue                         = queue;
            _poisonQueue                   = CreatePoisonQueueReference(queue.ServiceClient, queue.Name);
            _queueConfiguration            = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _messageEnqueuedWatcherSetter  = messageEnqueuedWatcherSetter;
            _sharedContextProvider         = sharedContextProvider;
            _log             = log;
            _instanceFactory = instanceFactory;
        }
 public ServiceBusTriggerExecutor(ITriggeredFunctionInstanceFactory <BrokeredMessage> instanceFactory,
                                  IFunctionExecutor innerExecutor)
 {
     _instanceFactory = instanceFactory;
     _innerExecutor   = innerExecutor;
 }
예제 #5
0
 public TriggeredFunctionExecutor(FunctionDescriptor descriptor, IFunctionExecutor executor, ITriggeredFunctionInstanceFactory <TTriggerValue> instanceFactory)
 {
     _descriptor      = descriptor;
     _executor        = executor;
     _instanceFactory = instanceFactory;
 }
        public BlobListenerFactory(IHostIdProvider hostIdProvider,
                                   IQueueConfiguration queueConfiguration,
                                   IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
                                   IContextSetter <IBlobWrittenWatcher> blobWrittenWatcherSetter,
                                   IContextSetter <IMessageEnqueuedWatcher> messageEnqueuedWatcherSetter,
                                   ISharedContextProvider sharedContextProvider,
                                   TextWriter log,
                                   string functionId,
                                   IStorageAccount account,
                                   IStorageBlobContainer container,
                                   IBlobPathSource input,
                                   ITriggeredFunctionInstanceFactory <IStorageBlob> instanceFactory)
        {
            if (hostIdProvider == null)
            {
                throw new ArgumentNullException("hostIdProvider");
            }

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

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

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

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

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

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

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

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

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

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

            _hostIdProvider                = hostIdProvider;
            _queueConfiguration            = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _blobWrittenWatcherSetter      = blobWrittenWatcherSetter;
            _messageEnqueuedWatcherSetter  = messageEnqueuedWatcherSetter;
            _sharedContextProvider         = sharedContextProvider;
            _log             = log;
            _functionId      = functionId;
            _account         = account;
            _container       = container;
            _input           = input;
            _instanceFactory = instanceFactory;
        }
예제 #7
0
 public QueueTriggerExecutor(ITriggeredFunctionInstanceFactory <IStorageQueueMessage> instanceFactory,
                             IFunctionExecutor innerExecutor)
 {
     _instanceFactory = instanceFactory;
     _innerExecutor   = innerExecutor;
 }
 public void Register(string functionId, ITriggeredFunctionInstanceFactory <IStorageBlob> instanceFactory)
 {
     _registrations.AddOrUpdate(functionId, instanceFactory, (i1, i2) => instanceFactory);
 }