Tryst::UI::EventBus(T)
@api private
Internal build-time plumbing for Document (see #subscribe/#notify) - not a public event mechanism. An app's own events are Signal (./signal.cr): one typed object per event name, connected to directly, with a compile-time-checked emit and no Symbol to typo. EventBus predates Signal and was briefly public itself (Session#on/#emit/#off); that surface is gone now that Signal covers what it covered, so nothing outside Document should construct one of these.
In-process publish/subscribe for decoupled events - not Tk events. Pure Crystal, no Tk/interpreter involved.
Generic over the payload type T, unlike ruby-tryst's EventBus (which forwards arbitrary *args/**kwargs to each subscriber - Ruby doesn't care what they are). Crystal needs every subscriber Proc's parameter types fixed at compile time, so each owner picks its own T: Document uses one EventBus(Node | String) internally for its build-time :push/:pop/:append hooks. **kwargs forwarding itself is dropped entirely - nothing in this port's scope emits any, and a Proc can't accept them generically the way a Ruby block can.
Instance methods
Emit a named event carrying no payload at all - the most common kind ("saved", "closed"). Needs to be its own overload rather than falling out of the one below: a splat with a type restriction requires at least one argument in Crystal. Emitting an event nobody listens to is ordinary, so every lookup here is a plain miss rather than a subscriber list conjured into existence and kept forever.
Emit a named event to every current subscriber, in subscription order.