This repository has been archived on 2026-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
anvillm/internal
Levi Neely 407b3732af Replace event queue with in-memory pub-sub event bus
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>
2026-02-22 09:38:14 +01:00
..
backend minor fix 2026-02-21 21:05:18 +01:00
backends Add ollama backend support 2026-02-21 21:03:55 +01:00
debug debug mode, don't print to main window, rename go module and main window 2026-02-10 21:45:27 +01:00
eventbus Replace event queue with in-memory pub-sub event bus 2026-02-22 09:38:14 +01:00
mailbox Remove deprecated audit endpoint 2026-02-20 22:18:53 +01:00
p9 Replace event queue with in-memory pub-sub event bus 2026-02-22 09:38:14 +01:00
sandbox Implement layered sandbox configuration system 2026-02-15 18:57:55 +01:00
session Replace event queue with in-memory pub-sub event bus 2026-02-22 09:38:14 +01:00