An event handler

v1.0.1 2018-04-06 19:38 UTC

This package is auto-updated.

Last update: 2021-11-05 12:16:54 UTC

README Code Climate Build Status Packagist Packagist

Basic Use

An event system handler. Queue callbacks to be executed when needed by other parts of the application. Can be used to trigger actions or filter things. Events are one time use by default, but you can also have them persist for multiple uses. This is not a true async thing like React - these filters will block, so they are safe for inline filtering.

Nether\Ki::Queue(string EventName, callable Callback, bool Persist default false);


That will queue an event to happen the first time we call it.

Nether\Ki::Flow(string EventName, array Args default null);


After the first Flow, that event will be removed from the queue and additional flows will not proc it until you requeue it.

Rigging a Filter Event

To create a filter, you'll probably want to make a persistant event, with one of the few valid uses of pass-by-reference in PHP.

	if(is_string($input)) $input = str_replace('@','',$input);

Then when you want to filter...


And that filter will continue to work for the duration of the app.


Use Composer.

"require": { "netherphp/ki":"~1.0.0" }