2017 © Pedro PelĂĄez
 

library event

Listen to Supervisor events in PHP

image

supervisorphp/event

Listen to Supervisor events in PHP

  • Monday, January 16, 2017
  • by mark.sagikazar
  • Repository
  • 2 Watchers
  • 6 Stars
  • 7,759 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Supervisor Event

Latest Version Software License Total Downloads Test Suite, (*1)

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

Install

Via Composer, (*3)

$ composer require supervisorphp/event

Usage

Supervisor has this pretty good feature: notify you(r listener) about it's events., (*4)

The main entry point is the Listener. Listenerss wait for a Handler in the main listening logic. Handlers get a Notification when an event occurs., (*5)

$handler = new \Supervisor\Event\Handler\CallbackHandler(function(\Supervisor\Event\Notification $notification) {
    echo $notification->getHeader('eventname');
});

$listener = new \Supervisor\Event\Listener\StandardListener;
$listener->listen($handler);

Currently available listeners:, (*6)

  • 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:, (*7)

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

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

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

Testing

phpspec run

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

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

The Versions

16/01 2017

dev-master

9999999-dev http://supervisorphp.com

Listen to Supervisor events in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by MĂĄrk SĂĄgi-KazĂĄr

event supervisor listener

14/01 2015

v0.1.0

0.1.0.0 http://supervisorphp.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