WebSocket hub with channel-based pub/sub
Find a file
Snider 53d8a15544 test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers
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>
2026-02-20 05:14:11 +00:00
CLAUDE.md feat(ws): phase 0 coverage (98.5%) + phase 1 connection resilience 2026-02-20 01:17:56 +00:00
FINDINGS.md feat(ws): phase 0 coverage (98.5%) + phase 1 connection resilience 2026-02-20 01:17:56 +00:00
go.mod feat: extract go-ws from core/go pkg/ws 2026-02-19 16:08:52 +00:00
go.sum feat: extract go-ws from core/go pkg/ws 2026-02-19 16:08:52 +00:00
TODO.md test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers 2026-02-20 05:14:11 +00:00
ws.go test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers 2026-02-20 05:14:11 +00:00
ws_bench_test.go test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers 2026-02-20 05:14:11 +00:00
ws_test.go test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers 2026-02-20 05:14:11 +00:00