Skip to content
docsv0.3.0

InMemoryTuiEventBus

Synchronous in-process event bus for the TUI: listeners run in registration order, inline, on the same tick the event is published.

InMemoryTuiEventBus::subscribe()

public function subscribe(string $eventType, callable $listener): void

Registers a listener for one event type; listeners run in registration order.

Parameters

Parameters of subscribe()
NameTypeDescription
$eventTypestring
$listenercallable

InMemoryTuiEventBus::publish()

public function publish(Milpa\Live\ValueObjects\Tui\TuiEvent $event): void

Runs every listener for this event's type, inline and synchronously.

Parameters

Parameters of publish()
NameTypeDescription
$eventMilpa\Live\ValueObjects\Tui\TuiEvent

InMemoryTuiEventBus::history()

public function history(): array