Ejemplo n.º 1
0
        public Task<IListener> CreateListenerAsync(ListenerFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            IStorageBlobContainer container = _client.GetContainerReference(_path.ContainerNamePattern);

            var factory = new BlobListenerFactory(_hostIdProvider, _queueConfiguration,
                _backgroundExceptionDispatcher, _blobWrittenWatcherSetter, _messageEnqueuedWatcherSetter,
                _sharedContextProvider, _log, context.Descriptor.Id, _account, container, _path, context.Executor);

            return factory.CreateAsync(context.CancellationToken);
        }
        public IListenerFactory CreateListenerFactory(FunctionDescriptor descriptor, ITriggeredFunctionExecutor executor)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            IStorageBlobContainer container = _client.GetContainerReference(_path.ContainerNamePattern);

            IListenerFactory listenerFactory = new BlobListenerFactory(_hostIdProvider, _queueConfiguration,
                _backgroundExceptionDispatcher, _blobWrittenWatcherSetter, _messageEnqueuedWatcherSetter,
                _sharedContextProvider, _log, descriptor.Id, _account, container, _path, executor);

            return listenerFactory;
        }