Sha256: 6c9f9343eacd23f5d38ae4f6621b7c18b059a33464c6016967995f8881ae5aeb
Contents?: true
Size: 1.3 KB
Versions: 40
Compression:
Stored size: 1.3 KB
Contents
require "pact_broker/webhooks/event_listener" require "pact_broker/events/subscriber" module PactBroker module Api module Resources module WebhookExecutionMethods def handle_webhook_events(event_context = {}) @webhook_event_listener = PactBroker::Webhooks::EventListener.new(webhook_options(event_context)) PactBroker::Events.subscribe(webhook_event_listener) do yield end end def schedule_triggered_webhooks webhook_event_listener&.schedule_triggered_webhooks end def finish_request if response.code < 400 schedule_triggered_webhooks end super end def webhook_options(event_context = {}) { database_connector: database_connector, webhook_execution_configuration: webhook_execution_configuration.with_webhook_context(event_context) } end private :webhook_options def webhook_execution_configuration application_context.webhook_execution_configuration_creator.call(self) end private :webhook_execution_configuration def webhook_event_listener @webhook_event_listener end private :webhook_event_listener end end end end
Version data entries
40 entries across 40 versions & 1 rubygems