Ejemplo n.º 1
0
        public PerperModuleListener(PerperModuleTriggerAttribute attribute, string delegateName,
                                    ITriggeredFunctionExecutor executor, IPerperFabricContext context)
        {
            _attribute    = attribute;
            _delegateName = delegateName;
            _executor     = executor;
            _context      = context;

            _listenCancellationTokenSource = new CancellationTokenSource();
        }
Ejemplo n.º 2
0
 public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
 {
     return(Task.FromResult <IListener>(_attribute switch
     {
         PerperStreamTriggerAttribute streamAttribute => new PerperStreamListener(streamAttribute,
                                                                                  context.Descriptor.FullName, context.Executor, _fabricContext, _logger),
         PerperWorkerTriggerAttribute workerAttribute => new PerperWorkerListener(workerAttribute,
                                                                                  context.Descriptor.FullName, _workerTriggerValueConverter, context.Executor, _fabricContext),
         PerperModuleTriggerAttribute moduleAttribute => new PerperModuleListener(moduleAttribute,
                                                                                  context.Descriptor.FullName, context.Executor, _fabricContext),
         _ => throw new ArgumentException()
     }));