parameters:
  smartesb.handlers.events_deferring.class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\DeferredEventsHandler
  event_dispatcher.class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\EventDispatcher

services:
  deferred_event_dispatcher:
    class: "%event_dispatcher.class%"
    arguments:
      $container: '@service_container'

  smartesb.handlers.events:
      class: "%smartesb.handlers.events_deferring.class%"
      calls:
        - [setId, ['smartesb.handlers.events']]
        - [setEventDispatcher, ['@deferred_event_dispatcher']]
        - [setFlowsVersion, ["%smartesb.flows_version%"]]

  smartesb.registry.event_filters:
    class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\EventFiltersRegistry

parameters:
  smartesb.handlers.events_deferring.class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\DeferredEventsHandler
  event_dispatcher.class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\EventDispatcher

services:
  deferred_event_dispatcher:
    decorates: 'event_dispatcher'
    class: "%event_dispatcher.class%"
    arguments:
      $container: '@service_container'

  smartesb.handlers.events:
      class: "%smartesb.handlers.events_deferring.class%"
      calls:
        - [setId, ['smartesb.handlers.events']]
        - [setEventDispatcher, ['@event_dispatcher']]
        - [setFlowsVersion, ["%smartesb.flows_version%"]]

  smartesb.registry.event_filters:
    class: Smartbox\Integration\FrameworkBundle\Tools\EventsDeferring\EventFiltersRegistry

Set the deferred dispatcher as a decorator in other to override the built in
MINT-4497: Set the deferred dispatcher as a decorator in other to override the built in
