2017 © Pedro Peláez
 

library eventdispatcher

Smooth Php Event Dispatcher

image

smoothphp/eventdispatcher

Smooth Php Event Dispatcher

  • Tuesday, November 29, 2016
  • by mrsimonbennett
  • Repository
  • 2 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 22 Versions
  • 0 % Grown

The README.md

Event Dispatcher

Smoothphps event dispatcher is yet another php event dispatcher, what makes this package different to the others is its ability to detect when a Event listener should fire at run time., (*1)

In event sourcing you may which to rerun all of your events back though there handlers, which is great however some handlers you do not wish to run again. This tends to be handlers which generate new events or talk to 3rd parties. Otherwise as you replay your events over and over, you will generate new duplicate events. This can be avoided by implementation a Projection interface., (*2)


use SmoothPhp\Contracts\EventDispatcher\Projection; use SmoothPhp\EventDispatcher\ProjectEnabledDispatcher; class MemberRegistered implements Event { ... } final class ProjectionOnlyMemberMysqlListener implements Projection { public function handleEvent(MemberRegistered $e) { db()->insert($e) } } final class NoneProjectionOnlyMemberThirdPartListener { /** Do not run on reply */ public function handleEvent(MemberRegistered $e) { curl()->send($e) } } $dispatcher = new ProjectEnabledDispatcher(); $dispatcher->addListener('MemberRegistered', [new ProjectionOnlyMemberMysqlListener, 'handleEvent']); $dispatcher->addListener('MemberRegistered',[new ProjectEnabledDispatcher,'handleEvent']); $dispatcher->dispatch('MemberRegistered', [],true);

When calling the dispatch method we specify we only want to run projections. This enables us to change at run time. When true the event dispatcher will not fire to any listener that does not implement Projection, (*3)

The Versions

29/11 2016

dev-master

9999999-dev

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

29/11 2016

v3.1.0

3.1.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

29/11 2016

v4.0.0

4.0.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

29/11 2016

v4.0.1

4.0.1.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

29/11 2016

v5.0.0

5.0.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v1.1.4

1.1.4.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v1.1.6

1.1.6.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v1.1.7

1.1.7.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v1.1.8

1.1.8.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v2.0.0

2.0.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v3.0.0

3.0.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

26/11 2015

v3.0.1

3.0.1.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

23/11 2015

v1.1.3

1.1.3.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

21/11 2015

v1.1.2

1.1.2.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

19/10 2015

1.0.x-dev

1.0.9999999.9999999-dev

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

19/10 2015

v1.1.0

1.1.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

19/10 2015

v1.1.1

1.1.1.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

16/10 2015

v1.0.1

1.0.1.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

16/10 2015

v1.0.2

1.0.2.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

16/10 2015

v1.0.3

1.0.3.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

16/10 2015

v1.0.4

1.0.4.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

event dispatcher smooth php

14/10 2015

v1.0.0

1.0.0.0

Smooth Php Event Dispatcher

  Sources   Download

MIT

The Requires

  • php >=5.5.0
  • smoothphp/contract dev-master

 

The Development Requires

event dispatcher smooth php