2017 © Pedro Peláez
 

library async-event-dispatcher

Library to asincronously dispatch events

image

bodaclick/async-event-dispatcher

Library to asincronously dispatch events

  • Tuesday, February 11, 2014
  • by egulias
  • Repository
  • 4 Watchers
  • 4 Stars
  • 40 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

AsyncEventDispatcher Build Status

This lib is intended to allow for multiple "drivers" (a.k.a listeners) that publish using a fire and forget strategy, mostly within pub/sub software., (*1)

The approach is inspired in Symfony's EventDispatcher component. However, the AsyncDispatcher registers the driver to all the events that have been registered (by adding a driver) if no event is passed, calling the driver for all of them., (*2)

Installation

Install via composer. Add to your current composer.json require key: "bodaclick/async-event-dispatcher":"1.0.x-dev", (*3)

Usage

You have to add drivers to the AsyncEventDispatcher so when an AsyncEventInterface is fired it will be notified., (*4)

Adding a Driver


use BDK\AsyncEventDispatcher\AsyncEventDispatcher; use BDK\AsyncEventDispatcher\AsyncDriver\RabbitMQDriver; $driver = new RabbitMQDriver(); $ed = new AsyncEventDispatcher(); //Single event. It also registers the event $ed->addDriver($driver, 'event.name'); //All events available $ed->addDriver($driver);

Firing the even


use BDK\AsyncEventDispatcher\AsyncEventInterface; $event = new CustomEvent(); //implements AsyncEventInterface $ed->dispatch($event);

Available drivers

Only two drivers are available * RabbitMQ * File, (*5)

Feel free to PR with new drivers!, (*6)

Extension

Creating a new driver is as easy as implementing the AsyncEventDriverInterface, (*7)

The Versions

11/02 2014

dev-master

9999999-dev http://github.com/Bodaclick

Library to asincronously dispatch events

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Ferrari

dispatcher async event dispatcher

07/02 2014

1.0.1

1.0.1.0 http://github.com/Bodaclick

Library to asincronously dispatch events

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Ferrari

dispatcher async event dispatcher

07/02 2014

1.0.0

1.0.0.0 http://github.com/Bodaclick

Library to asincronously dispatch events

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Ferrari

dispatcher async event dispatcher