Search by

marko / broadcasting-amphp

markshust

Native async SSE broadcasting server on amphp for Marko Framework

Package info

github.com/marko-php/marko-broadcasting-amphp

Type:marko-module

pkg:composer/marko/broadcasting-amphp

Statistics

Installs: 3

Dependents: 0

Suggesters: 1

Stars: 0

0.11.0 2026-10-06 13:51 UTC

This package is auto-updated.

Last update: 2026-10-09 21:31:00 UTC


README

Native async SSE broadcasting server --- a self-hosted, PHP-only realtime server on amphp that holds thousands of Server-Sent Events connections per process and fans events out through marko/pubsub.

Installation

composer require marko/broadcasting-amphp

This installs marko/broadcasting, marko/amphp and marko/pubsub. You also need a pub/sub driver such as marko/pubsub-redis, and a log driver.

Quick Example

use Marko\Broadcasting\PrivateChannel;

// Publish (BroadcasterInterface is bound to AmphpBroadcaster): one pub/sub message, no HTTP call
$broadcaster->broadcast('shows.42', 'seat.sold', ['seat' => 'A1']);

// Give the browser an EventSource URL; private channels get a signed token
$url = $amphpSubscriberToken->streamUrl(['shows.42', new PrivateChannel('orders.7')], $authManager->user());
marko broadcasting:serve --port=8085

Documentation

Full usage, API reference, and examples: marko/broadcasting-amphp