WebSocket hub with channel-based pub/sub
Add 16 additional test functions covering Hub.Run lifecycle (register, broadcast delivery, unregister, duplicate unregister), Subscribe/ Unsubscribe channel management (multiple channels, idempotent, partial leave), SendToChannel with multiple subscribers, SendProcessOutput/ SendProcessStatus edge cases (no subscribers, non-zero exit), readPump ping timestamp verification, writePump batch message delivery, and integration tests (unsubscribe stops delivery, broadcast reaches all, disconnect cleans up everything, concurrent broadcast+subscribe). Add ws_bench_test.go with 9 comprehensive benchmarks using b.Loop() (Go 1.25+) and b.ReportAllocs(): broadcast (100 clients), channel send (50 subscribers), parallel variants, message marshalling, WebSocket end-to-end round-trip, subscribe/unsubscribe cycle, multi-channel fanout, and concurrent subscriber registration. Add SPDX-Licence-Identifier headers to ws.go, ws_test.go, ws_bench_test.go. go vet clean, go test -race clean, 66 tests + 11 benchmarks total. Co-Authored-By: Virgil <virgil@lethean.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| CLAUDE.md | ||
| FINDINGS.md | ||
| go.mod | ||
| go.sum | ||
| TODO.md | ||
| ws.go | ||
| ws_bench_test.go | ||
| ws_test.go | ||