diff options
| author | bndw <ben@bdw.to> | 2026-02-07 21:22:51 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-07 21:22:51 -0800 |
| commit | e79f9ad89556000521b43ce5ff4eb59dd00768b0 (patch) | |
| tree | 9f8750e3c5431faf43fa672cb78a733a85d9dcfe /envelope.go | |
| parent | d4fd2467d691a69a0ba75348086424b9fb33a297 (diff) | |
refactor: race-safe Subscribe/Fetch API with channel-based Publish
- Add mutex-guarded send/stop on Subscription to prevent send-on-closed-channel
panics and data races
- Split Subscribe (streams after EOSE) and Fetch (closes on EOSE) per NIP-01
- Rewrite Publish to use channel-based OK dispatch instead of calling Receive
directly, which raced with the auto-started Listen goroutine
- Clean up all subscriptions when Listen exits so range loops terminate
- Update tests and examples for new API
Diffstat (limited to 'envelope.go')
0 files changed, 0 insertions, 0 deletions
