NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist
✨ Statically on composer install/update compiled (async) event dispatcher
Latest stable
2.7.0
Last release 7 months ago
24 Apr 2026
Ships fairly regularly
a new release about every 7 months
Nearly every release is documented
notes for 14 of 14 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
14 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
Mainly small non-userfacing improvements, but deprecated adding this to composer.json:
Mainly small non-userfacing improvements, but deprecated adding this to composer.json:
{
"extra": {
"wyrihaximus": {
"broadcast": {
"has-listeners": true
}
}
}
}
Instead require wyrihaximus/broadcast-contracts instead. The above extra addition will continue to work untill the next major version of this package.
composer.json extra thanks to @WyriHaximusYour coding agent can read these notes before it upgrades. Set up the MCP server →
Total pull requests resolved: 1
Total pull requests resolved: 40
Total pull requests resolved: 5
Swapped out some boring internals into wyrihaximus/generative-composer-plugin-tooling and address a dependency mis require.
Swapped out some boring internals into wyrihaximus/generative-composer-plugin-tooling and address a dependency mis require.
Total pull requests resolved: 3
Total pull requests resolved: 1
Brings template types
Total pull requests resolved: 31
Adds support for calling listeners in PHP 8.1 fibers using `react/async` async(). And as such raised the minimum PHP version to 8.1.
Adds support for calling listeners in PHP 8.1 fibers using react/async async(). And as such raised the minimum PHP version to 8.1.
Before you can use react/async's await(). In a listener, you must change the interface from Listener to AsyncListener. After that, every time that listener is called it will be run inside a fiber and the dispatcher will wait for it to finish. This brings it fully in line with non-non-blocking listeners.
Technically it is possible to use await() in non-async listeners but that will block the rest of the process. Where using async listeners only that listener is awaited in a fiber and will not block the rest of the process.
This release also contains a bug fix (#180) that was caused by not rethrowing any caught and logged exceptions.
src/ thanks to @WyriHaximusTotal pull requests resolved: 1
Total pull requests resolved: 5
Total pull requests resolved: 1
Total pull requests resolved: 63
To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^.
To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^.
composer require wyrihaximus/broadcast
Any package setting the following in their composer.json will have its autoloading directories and files scanned
for any classes that implements WyriHaximus\Broadcast\Contracts\Listener. Each public method with a concrete object
type hint on classes implementing WyriHaximus\Broadcast\Contracts\Listener will be registered as an event listener
for that object in the type hint.
{
"extra": {
"wyrihaximus": {
"broadcast": {
"has-listeners": true
}
}
}
}
To use those automatically picked up event listeners, use the WyriHaximus\Broadcast\ContainerListenerProvider, which
needs a PSR-11 container to work.
The following example uses the dummy event and listener coming with this package:
use WyriHaximus\Broadcast\ContainerListenerProvider;
use WyriHaximus\Broadcast\Dispatcher;
use WyriHaximus\Broadcast\Dummyvent;
$event = new Event();
(new Dispatcher(new ContainerListenerProvider($container), $logger))->dispatch($event)
The following listener is from one of my apps and listeners both on intialize and shutdown events. The logic has been taken out, but logging is left intact to demonstracte a simple listener example.
<?php
declare(strict_types=1);
namespace WyriHaximus\Apps\WyriHaximusNet\GitHub\Ingest;
use Mammatus\LifeCycleEvents\Initialize;
use Mammatus\LifeCycleEvents\Shutdown;
use Psr\Log\LoggerInterface;
use WyriHaximus\Broadcast\Contracts\Listener;
final class Consumer implements Listener
{
private LoggerInterface $logger;
public function __construct(ConsumerContract $consumer, Producer $producer, LoggerInterface $logger)
{
$this->logger = $logger;
}
public function start(Initialize $event): void
{
$this->logger->debug('Starting to consume ingested GitHub WebHook events');
}
public function stop(Shutdown $event): void
{
$this->logger->debug('Stopping to consume ingested GitHub WebHook events');
}
}
35: Bump to composer v2 thanks to @WyriHaximus
28: Modernize set up thanks to @WyriHaximus
27: Set composer event priority to lowest possible and ensure this is the last plugin to run thanks to @WyriHaximus
One column per quarter.