Topic
An in-process publish/subscribe topic, typed by its message.
A Topic[A] is a value the application creates and shares — a field on the app object, a per-entity lookup, whatever names it for both sides. Anything may publish: a handler, a component's handle, boot's background work. Only Component.init may subscribe, through Init, which is what keeps the subscription set from growing by one per re-render.
Delivery is a hand-off, never work: publish runs each subscriber's callback on the publisher's thread, and that callback — built by Init.subscribe — only enqueues into the page's mailbox. The re-render happens on the page's own thread (design/live.md §2.4), so a publisher holding a scarce resource (a database connection, mid-transaction) never renders pages with it.
Cross-node fan-out is a later implementation behind this same surface (design/live.md §2.8); nothing here names a transport.
Attributes
- Source
- Topic.scala
- Graph
-
- Supertypes