PHPackages                             h2sf/events - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. h2sf/events

ActiveLibrary

h2sf/events
===========

description

0.4.3.1(1mo ago)0572proprietaryPHP

Since Jul 30Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/h2s-framework/events)[ Packagist](https://packagist.org/packages/h2sf/events)[ RSS](/packages/h2sf-events/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (8)Used By (2)

### Event manager

[](#event-manager)

IMPORTANT - Consumer methods / callables require a type. This type is used to figure out on what event should consumer be executed. Missing type will throw Exception. If you want to execute for any Event - use `EventInterface`. EventManager uses `instanceof` to check if event can be used for a consumer

```
$logger = new BasicLogger(__DIR__.'/logs.log');
// Initilize new instance
// Logger is required to log uncaught exceptions from each consumer.
// One consumer's exception doesn't have to stop others
$eventManager = new EventManager($logger);

// Optional, set by default
// This will cause execution of consumers at the moment of queueEvent()
$eventManager->setConsumeImmediately(true);

// If you want...
$eventManager->setThrowOnFirstConsumerError(true);
// It will use logger first and then throw

// Anonymous classes can be registered - as well as just objects implementing the ConsumerInterface
$eventManager->addListener(new class implements ConsumerInterface {
    public function consumeEvent(EventInterface $event)
    {
        echo "[ANY EVENT] ";
    }
});

// Callables can be registered
$eventManager->addListener(function(EventInitialized $event) use($bootstrap) {
    echo "[INITIALIZED, running at {$bootstrap->getTargetTPS()} TPS]\n";
});

// And you post / execute consumers
$eventManager->queueEvent(new \Siarko\CliBootstrap\Events\EventInitialized());

// Also, if setConsumeImmediately(false), consumers won't be executed.
// Events will be queued and then consumers will execute at once with
$eventManager->consumeEvents();

// If you want to postpone execution of a selected event, use
$eventManager->queueEvent(new \Siarko\CliBootstrap\Events\EventInitialized(), postpone: true);
//It will execute the consumers for this event either with next normal event execution of with
$eventManager->consumeEvents();
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance93

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~103 days

Recently: every ~0 days

Total

7

Last Release

35d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb4c9c2574f92f292bc0fe150ce64ec061bc94f2a20c0ebf9fec9a0bc3e374e3?d=identicon)[h2s-framework](/maintainers/h2s-framework)

---

Top Contributors

[![Siarko](https://avatars.githubusercontent.com/u/13398512?v=4)](https://github.com/Siarko "Siarko (8 commits)")

### Embed Badge

![Health badge](/badges/h2sf-events/health.svg)

```
[![Health](https://phpackages.com/badges/h2sf-events/health.svg)](https://phpackages.com/packages/h2sf-events)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
