PHP Event Correlator is an event correlation tool to process a stream of events, make decisions based on Rules sets, and perform actions based on these Rules.
Event correlation is useful in many areas. For example, log processing, microservice coordination, IoT event processing.
PHP-EC is being used in production for multiple IoT projects, some processing 10M+ events per day from multiple disparate systems.
The package is compatible with PHP 8.0+
You can add the library as project dependency using Composer:
composer require edgetelemetrics/eventcorrelation
Performance can be improved by installing optional PHP extensions (ext-libuv or ext-libev)
See /examples directory
TBC.
Components are:
-
Events: An event is made up of a type, date, id, and data
-
Event Stream: A time ordered stream of events
-
Input Processes: programs that provide event streams into PHP-EC. These can be PHP scripts, NodeJS, Bash script etc.
-
Actions: Programs that perform tasks when requested. This may be writing to a database, sending an email etc.
-
Rules: Rules define a set of events to be processed within a defined time period. Once a Rule is matched or a defined timeout period is exceeded the rule can:
- run Actions (for example send email, write to database)
- emit Events (emit a new or modified event for another Rule to handle [chaining rules])
- run an additional input process (load more data into the system)
PHP-EC supports rules that can call actions based on Cron time expressions, system start and system shutdown.
MIT, see LICENSE file.
Bug reports (and small patches) can be submitted via the issue tracker. Forking the repository and submitting a Pull Request is preferred for substantial patches.