Expand description
Pub/sub topic routing for kernel IPC.
The TopicRouter manages topic subscriptions and delivers
published messages to all subscribers. Topics are arbitrary
strings (e.g. “build-status”, “test-results”, “agent.spawned”).
Subscriptions are stored in a DashMap for lock-free concurrent
access. Dead subscribers (processes that have exited) are lazily
cleaned up during publish.
§Subscriber kinds
Subscriptions are generalized via SubscriberSink. Two sink
kinds exist today:
SubscriberSink::PidInbox— an in-kernel agent identified byPid. The A2A router delivers to itsmpscinbox.SubscriberSink::ExternalStream— an external Unix-socket client (Python bridge, another Claude Code session) that holds the read end of a channel the daemon writes one JSON line per published message into.
Structs§
- Subscriber
Id - Unique identifier for an external streaming subscription.
- Subscription
- A topic subscription entry (wire-format; describes a PID-based subscription only — external stream sinks are ephemeral and not persisted in this shape).
- Topic
Router - Pub/sub topic router for kernel IPC.
Enums§
- Subscriber
Sink - A subscription sink — where a delivered topic message goes.