PHP Event Emitter

Overview

InitPHP EventEmitter

This library has been designed to emit events in its simplest and simplest form.

Requirements

  • PHP 5.6 or higher

Installation

composer require initphp/event-emitter

or Manuel Installation :

Download this repository. And include the src/Init.php file in your project.

Usage

require_once "vendor/autoload.php";
use InitPHP\EventEmitter\EventEmitter;

$events = new EventEmitter();

$events->on('hello', function ($name) {
    echo 'Hello ' . $name . '!' . PHP_EOL;
}, 99);

$events->on('hello', function ($name) {
    echo 'Hi ' . $name . '!' . PHP_EOL;
}, 10);

// Emit
$events->emit('hello', ['World']);

Output :

Hi World!
Hello World!

Credits

License

Copyright © 2022 MIT License

You might also like...
Allows installing Drupal extensions event if not compatible with installed drupal/core package

mglaman/composer-drupal-lenient Lenient with it, Drupal 10 with it. Why? The Drupal community introduced a lenient Composer facade that modified the d

JsonCollectionParser - Event-based parser for large JSON collections (consumes small amount of memory)

Event-based parser for large JSON collections (consumes small amount of memory). Built on top of JSON Streaming Parser This packa

Command and event buses interface and logic.

CoreBus - Command and Event buses interfaces Discrete command bus and domain event dispatcher interfaces for message based architectured projects. Dis

Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda.
Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda.

Our Wedding Website Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda. ?

The easiest way to get started with event sourcing in Laravel
The easiest way to get started with event sourcing in Laravel

Event sourcing for Artisans 📽 This package aims to be the entry point to get started with event sourcing in Laravel. It can help you with setting up

The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3
The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3

2021 Nightly Builds Repository PHP-Nuke Evolution Xtreme Developers TheGhost - Ernest Allen Buffington (Lead Developer) SeaBeast08 - Sebastian Scott B

A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

PHP Meminfo is a PHP extension that gives you insights on the PHP memory content

MEMINFO PHP Meminfo is a PHP extension that gives you insights on the PHP memory content. Its main goal is to help you understand memory leaks: by loo

A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

Releases(1.0)
Owner
InitPHP
InitPHP is a project that open source develops and publishes various modules/libraries from which you can build large or small structures.
InitPHP
True coroutines for PHP>=8.1 without worrying about event loops and callbacks.

Moebius Pure coroutines for PHP 8.1. No promises and callbacks needed. Just pure parallel PHP code inside coroutines. Moebius Band: A loop with only o

Moebius for PHP 141 Jun 16, 2022
A high-performance event loop library for PHP

?? A high-performance event loop library for PHP ??

workbunny 13 Dec 22, 2022
Ecotone Framework is Service Bus Implementation. It enables message driven architecture and DDD, CQRS, Event Sourcing PHP

This is Read Only Repository To contribute make use of Ecotone-Dev repository. Ecotone is Service Bus Implementation, which enables message driven arc

EcotoneFramework 308 Dec 29, 2022
A "from scratch" PHP-based implementation of Event-Sourcing

In here, you will find a "from scratch" PHP-based implementation of Event-Sourcing, kept to a minimum on purpose, to allow workshop attendees to explore and experiment with its concepts.

Marco Pivetta 94 Jan 1, 2023
An Infection + Last Man Standing Event plugin written for OwnagePE

KitPvPEvent An Infection + Last Man Standing Event plugin written for OwnagePE This plugin was a speedcode. I kinda woke up really late on the day I w

OwnagePE Network 2 May 26, 2022
Psalm plugin for patchlevel/event-sourcing

event-sourcing-psalm-plugin psalm plugin for event-sourcing library. installation composer require --dev patchlevel/event-sourcing-psalm-plugin confi

patchlevel 4 Dec 14, 2022
This library is an implementation of League\Event for Slim Framework

Slim Event Dispatcher This library is an implementation of League\Event for Slim Framework. This works with the latest version of Slim (V3). Installat

Aneek Mukhopadhyay 7 Aug 23, 2022
Notify instructors about unconfirmed event registrations.

SAC Event Registration Reminder Folgende Idee: Es wird ein Reminder-Tool benötigt, welches Tourenleitende und Bergführer/innen per E-Mail daran erinne

Marko Cupic 2 Apr 25, 2022
A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.

Laravel SES Tracking Setup the AWS infrastructure to handle email events using SES/SNS and http/s endpoints with a single Laravel artisan command. Thi

null 11 Apr 26, 2022
Implement event systems, signal slots, intercepting filters, and observers.

zend-eventmanager Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-eventmanager. zend-eventmanager is designed for the fol

Zend Framework 1.7k Dec 9, 2022