touka/docs
wjqserver 2f94763c65 fix(SSE)!: redesign EventStreamChan to prevent context pool recycling
BREAKING CHANGE: EventStreamChan signature changed from
  (chan<- Event, <-chan error)
to
  (eventChan <-chan Event)
The caller now creates and passes the channel instead of receiving it.
The errChan return value is removed.

The old non-blocking design allowed the handler to return before the SSE
stream ended, causing ServeHTTP to return the Context to the pool while
the internal goroutine was still writing to the pooled writer — a data
race across requests. The new blocking design keeps the handler inside
EventStreamChan until the event channel is closed or the client
disconnects, ensuring the Context remains bound throughout the stream.

- Caller creates channel, producer goroutine sends events
- EventStreamChan blocks handler until stream ends
- Internal goroutine captures stable references (Flusher, context.Context)
  instead of holding *Context pointer
- Nil guard on Flusher type assertion
- Add sse_test.go covering blocking, disconnect, and event format
- Update docs/sse.md for new API
2026-03-29 15:42:01 +08:00
..
advanced.md feat: add built-in reverse proxy support 2026-03-29 00:33:56 +08:00
context.md docs: 补充完善文档内容 2026-03-22 10:13:05 +08:00
error-handling.md docs: add comprehensive documentation in Chinese 2026-02-18 14:28:03 +00:00
introduction.md feat: add built-in reverse proxy support 2026-03-29 00:33:56 +08:00
middleware.md docs: 修复文档中的API方法名和参数错误 2026-03-22 09:27:20 +08:00
quickstart.md docs: 修复文档中的API方法名和参数错误 2026-03-22 09:27:20 +08:00
reverse-proxy.md docs: explain reverse proxy query normalization 2026-03-29 01:48:50 +08:00
routing.md docs: 补充完善文档内容 2026-03-22 10:13:05 +08:00
sse.md fix(SSE)!: redesign EventStreamChan to prevent context pool recycling 2026-03-29 15:42:01 +08:00
static-files.md docs: 修复文档中的API方法名和参数错误 2026-03-22 09:27:20 +08:00