I, Larry Garfield, being of debatably sound mind and body, acting in my
capacity as Editor of PSR-14, do hereby call a Readiness Vote for PSR-14,
"Event Dispatcher".
This vote is for members of the PSR-14 Working Group only, who are:
Larry Garfield
Cees-Jan Kiewiet
Elizabeth Smith
Matthew O'Phinney
Ryan Weaver
Benni Mack
If you are not one of those people, please do not vote on this thread.
The spec to be voted on is here:
https://github.com/php-fig/fig-standards/blob/master/proposed/event-dispatcher.md
https://github.com/php-fig/fig-standards/blob/master/proposed/event-dispatcher-meta.md
Additionally, a Composer package with the spec-defined interfaces is here (the
0.7.0 tag):
https://github.com/php-fig/event-dispatcher
https://packagist.org/packages/psr/event-dispatcher
A set of utilities created by the Working Group (that are not part of the spec
proper but account for common shared use cases) is here (the 0.7.2 tag):
https://github.com/php-fig/event-dispatcher-util
https://packagist.org/packages/fig/event-dispatcher-util
Additionally, the Working Group offers the following implementations as
demonstration of the viability of the specification:
* Tukio (
https://github.com/Crell/Tukio, 0.7.2 tag): A full implementation of
the specification written by Larry Garfield
* Phly Event Dispatcher (
https://github.com/phly/phly-event-dispatcher): A
full implementation of the specification written by Matthew O'Phinney
Additionally, Matthew has produced a prototype implementation that uses the
Swoole extension to defer listener execution asynchronously. From Matthew:
----------
-
https://github.com/weierophinney/mwop.net/blob/master/src/Blog/Listener/
BlogPostEventListenersDelegator.php - this shows three listeners on the same
event being attached to a provider. The last one on there is interesting,
because:
-
https://github.com/weierophinney/mwop.net/blob/master/src/Blog/Listener/
CacheBlogPostListenerFactory.php#L21-L27 it gets decorated as a queueable
listener, and operates async.
Another one:
-
https://github.com/weierophinney/mwop.net/blob/master/src/Contact/
SendMessageListenerDelegator.php - this registers a single listener for an
event to a provider. This listener is also interesting:
-
https://github.com/weierophinney/mwop.net/blob/master/src/Contact/
SendMessageListenerFactory.php#L37-L43 - because it, too, gets decorated as a
queueable listener, and operates async.
How does that work?
-
https://github.com/phly/phly-swoole-taskworker/blob/master/src/
QueueableListener.php#L40 - enqueues a `Task` instance with the listener as
the handler, and the event as the sole argument. Swoole then runs it via its
task workers.
----------
The vote will remain open for 2 weeks ending on 30 January, or until all 6 WG
members have voted, whichever comes first. If it meets a 2/3 majority, the
spec will go to the Core Committee for Review, moderated by our Sponsor, Cees-
Jan. It will be eligible for an Acceptance Vote one month from that date.
--Larry Garfield
PSR-14 Editor
PS: \o/