friendsofhyperf / ipc-broadcaster
IPC broadcaster component for Hyperf.
Fund package maintenance!
huangdijia
hdj.me/sponsors
Requires
- hyperf/event: ~3.1.0
README
Ipc Broadcaster component for Hyperf.
Installation
- Installation
composer require friendsofhyperf/ipc-broadcaster
Usage
- Closure
use function FriendsOfHyperf\IpcBroadcaster\broadcast; broadcast(function () { echo 'Hello world'; });
- Class
namespace App\Broadcasting; class FooMessage extends IpcMessage { public function __construct(private string $foo) { // } public function handle(): void { echo $this->foo; } } use function FriendsOfHyperf\IpcBroadcaster\broadcast; broadcast(new FooMessage('bar'));