atproto utils for zig zat.dev
atproto sdk zig

firehose: optional shouldStop handler hook master

subscribe blocks forever by design, which is right for steady-state consumers but leaves bounded ones (bootstrap capture, tests, graceful shutdown) no clean exit: future.cancel lands inside a websocket read, surfaces as a connection error, and the reconnect loop absorbs it forever. a handler may now declare shouldStop() bool — checked before every frame and around every reconnect — and subscribe returns cleanly when it goes true. comptime-gated like onError/onRawFrame: handlers without the decl are byte-for-byte unchanged.


+71 -3
1 changed file