Replaces the TTL-based event queue (internal/events) with a proper in-memory pub-sub bus (internal/eventbus) backed by simonfxr/pubsub. The agent/events 9P endpoint is now a streaming subscriber: clients block on reads and receive one JSON-encoded event per read until they disconnect. Each open(2) creates a per-connection subscription; clunk and connection teardown cancel it automatically. - internal/eventbus/bus.go: new package wrapping simonfxr/pubsub; provides Publish(agent, type, data) and Subscribe() -> (chan, cancel) - internal/events/events.go: deleted - internal/session/manager.go: SetEventQueue -> SetEventBus; all publish sites updated to use eventbus constants - internal/p9/server.go: fid gains eventCh/eventUnsub fields; Topen subscribes, Tread blocks on channel, Tclunk/serve-defer cancel - cmd/anvilsrv/main.go: wired to SetEventBus Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| backend | ||
| backends | ||
| debug | ||
| eventbus | ||
| mailbox | ||
| p9 | ||
| sandbox | ||
| session | ||