Download the PHP package jgswift/observr without Composer
On this page you can find all versions of the php package jgswift/observr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package observr
observr
PHP 5.5+ event layer
Description
observr is a generic event layer that provides a flexible foundation for event handling in a domain-agnostic and non-intrusive way.
Installation
Install via cli using composer:
Install via composer.json using composer:
Dependency
- php 5.5+
- react/promise
Usage
Subject
The Subject layer is a flexible interface/trait combination that provides a generic observer pattern implementation.
Basic example
State Change
delivers a combination and to the observing callbacks and can be used to define pass-thru state variables.
To implement a custom event interface just inherit or implement and
EventInterface (abbr.)
State status and exception container
EventAwareInterface (abbr.)
Performs state changes for
Event Namespacing
In order to handle events differently depending on package behavior it is possible to / with namespaces.
Success, Failure, Complete, Cancel
also implements the observer pattern itself and can be used to validate event results. The validation constants are , , , and
- is notified when all observers fire without failure
- is notified when any observer throws an exception
- is notified every time the state is changed without failure or cancellation
- is notifier when any observer invokes cancellation
Emitter
Emitter is a Subject where events are exposed into individual objects
Basic Emitter
EmitterInterface (abbr.)
Combining Emitters
Filtering
Filtering allows mapping procedures to be applied selectively
Streaming
A stream provides an easy way to wrap around multiple subjects at once and listen to many events.
Basic
StreamInterface (abbr.)
Related Package(s)
- jgswift/detectr - complex event processor