public WebhooksController(ICommandBus commandBus,
                           ISchemaWebhookRepository webhooksRepository,
                           IWebhookEventRepository webhookEventsRepository)
     : base(commandBus)
 {
     this.webhooksRepository      = webhooksRepository;
     this.webhookEventsRepository = webhookEventsRepository;
 }
Example #2
0
 public WebhookController(
     IUpdateNotificationService updateNotificationService,
     ApplicationDbContext context,
     IWebhookEventRepository webhookEvent
     )
 {
     _updateNotificationService = updateNotificationService;
     _context      = context;
     _webhookEvent = webhookEvent;
 }
 public WebhookPublisherBusiness(
     IWebhookSenderBusiness webhookSender,
     IWebhookEventRepository webhookEventRepository,
     IWebhookSubscriptionBusiness webhookSubscriptionBusiness,
     IWebhookDefinitionRepository webhookDefinitionRepository)
 {
     _webhookSender               = webhookSender;
     _webhookEventRepository      = webhookEventRepository;
     _webhookSubscriptionBusiness = webhookSubscriptionBusiness;
     _webhookDefinitionRepository = webhookDefinitionRepository;
 }
        public WebhookEnqueuer(TypeNameRegistry typeNameRegistry,
                               IWebhookEventRepository webhookEventRepository,
                               IWebhookRepository webhookRepository,
                               IClock clock,
                               JsonSerializer webhookSerializer)
        {
            Guard.NotNull(webhookEventRepository, nameof(webhookEventRepository));
            Guard.NotNull(webhookSerializer, nameof(webhookSerializer));
            Guard.NotNull(webhookRepository, nameof(webhookRepository));
            Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry));
            Guard.NotNull(clock, nameof(clock));

            this.webhookEventRepository = webhookEventRepository;
            this.webhookSerializer      = webhookSerializer;
            this.webhookRepository      = webhookRepository;

            this.clock = clock;

            this.typeNameRegistry = typeNameRegistry;
        }
        public WebhookDequeuer(WebhookSender webhookSender,
                               IWebhookEventRepository webhookEventRepository,
                               IWebhookRepository webhookRepository,
                               IClock clock,
                               ISemanticLog log)
        {
            Guard.NotNull(webhookEventRepository, nameof(webhookEventRepository));
            Guard.NotNull(webhookRepository, nameof(webhookRepository));
            Guard.NotNull(webhookSender, nameof(webhookSender));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(log, nameof(log));

            this.webhookEventRepository = webhookEventRepository;
            this.webhookRepository      = webhookRepository;
            this.webhookSender          = webhookSender;

            this.clock = clock;

            this.log = log;

            requestBlock =
                new ActionBlock <IWebhookEventEntity>(MakeRequestAsync,
                                                      new ExecutionDataflowBlockOptions {
                MaxDegreeOfParallelism = 32, BoundedCapacity = 32
            });

            blockBlock =
                new TransformBlock <IWebhookEventEntity, IWebhookEventEntity>(x => BlockAsync(x),
                                                                              new ExecutionDataflowBlockOptions {
                MaxDegreeOfParallelism = 1, BoundedCapacity = 1
            });

            blockBlock.LinkTo(requestBlock, new DataflowLinkOptions {
                PropagateCompletion = true
            });

            timer = new CompletionTimer(5000, QueryAsync);
        }