2017 © Pedro Peláez
 

library deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

image

enl/deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

  • Friday, November 4, 2016
  • by enl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Deferred Event Dispatcher

This package extends Symfony Event Dispatcher and adds an opportunity to defer a group of events to handle them later during request execution., (*1)

Bootstrap code:, (*2)

$eventsToDefer = ['event-to-defer', 'another-event'];
$dispatcher = new DeferredEventDispatcher();
$dispatcher->addSubscriber(new DeferredSubscriber($eventsToDefer));

When you dispatch event from the list, it will be intercepted by DeferredSubscriber and stored to execute later. So that, after you did all the essential things you need to fire special event to replay events:, (*3)

$dispatcher->dispatch(Events::PLAY_DEFERRED);

Subscribe DeferredSubscriber to another event

The idea of playing deferred events by firing Events::PLAY_DEFERRED may be not that good, because it sticks your codebase (not configuration) to this dispatcher., (*4)

So that, there is another opportunity:, (*5)

$subscriber = new DeferredSubscriber($eventsList);
$dispatcher->addSubscriber($subscriber);
$dispatcher->addListener('kernel.terminate', [$subscriber, 'playDeferred']);

The Versions

04/11 2016

dev-master

9999999-dev https://github.com/enl/deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

  Sources   Download

MIT License

The Requires

 

The Development Requires

symfony event dispatcher defer postpone

04/11 2016

v1.0.2

1.0.2.0 https://github.com/enl/deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

  Sources   Download

MIT License

The Requires

 

The Development Requires

symfony event dispatcher defer postpone

28/10 2016

v1.0.1

1.0.1.0 https://github.com/enl/deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

  Sources   Download

The Requires

 

The Development Requires

symfony event dispatcher defer postpone

28/10 2016

v1.0.0

1.0.0.0 https://github.com/enl/deferred-dispatcher

Extension for Symfony EventDispatcher which adds the way to defer handle of fired Event into later stage of request execution.

  Sources   Download

The Requires

 

The Development Requires

symfony event dispatcher defer postpone