2017 © Pedro Peláez
 

library supervisor-event

Listen to Supervisor events in PHP

image

indigophp/supervisor-event

Listen to Supervisor events in PHP

  • Wednesday, January 14, 2015
  • by mark.sagikazar
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Indigo Supervisor Event

Latest Version Software License Build Status Code Coverage Quality Score HHVM Status Total Downloads Dependency Status, (*1)

Listen to Supervisor events in PHP., (*2)

Install

Via Composer, (*3)

``` bash $ composer require indigophp/supervisor-event, (*4)


## Usage Supervisor has this pretty good feature: notify you(r listener) about it's events. The main entry point is the `Listener`. `Listeners`s wait for a `Handler` in the main listening logic. `Handler`s get a `Notification` when an event occurs. ``` php use Indigo\Supervisor\Event\Listener\Standard; use Indigo\Supervisor\Event\Handler\Callback; use Indigo\Supervisor\Event\Notification; $handler = new Callback(function(Notification $notification) { echo $notification->getHeader('eventname'); }); $listener = new Standard; $listener->listen($handler);

Currently available listeners:, (*5)

  • Standard: Listents to standard input stream, writes to standard output
  • Guzzle: Uses StreamInterface to provide an easy interface for reading/writting

Additionally you can use two exceptions to control the listeners itself:, (*6)

  • Indigo\Supervisor\Exception\StopListener: indicates that the Listener should stop listening for further events.
  • Indigo\Supervisor\Exception\EventHandlingFailed: indicates that handling the event failed, Listener should return with a FAIL response.

Any other unhandled exceptions/errors will cause the listener to stop., (*7)

Check the Supervisor docs for more about Events., (*8)

Testing

bash $ phpspec run, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

14/01 2015

dev-develop

dev-develop https://indigophp.com

Listen to Supervisor events in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Márk Sági-Kazár

event supervisor listener

04/01 2015

dev-master

9999999-dev https://indigophp.com

Listen to Supervisor events in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Márk Sági-Kazár

event supervisor listener

04/01 2015

v0.1.0

0.1.0.0 https://indigophp.com

Listen to Supervisor events in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Márk Sági-Kazár

event supervisor listener