feat: add idle timeout for StreamableHTTP sessions (#1994)
This commit is contained in:
parent
67458948ae
commit
23a615783e
1 changed files with 135 additions and 20 deletions
|
|
@ -24,6 +24,11 @@ This document contains critical information about working with this codebase. Fo
|
|||
- Coverage: test edge cases and errors
|
||||
- New features require tests
|
||||
- Bug fixes require regression tests
|
||||
- Avoid `anyio.sleep()` with a fixed duration to wait for async operations. Instead:
|
||||
- Use `anyio.Event` — set it in the callback/handler, `await event.wait()` in the test
|
||||
- For stream messages, use `await stream.receive()` instead of `sleep()` + `receive_nowait()`
|
||||
- Exception: `sleep()` is appropriate when testing time-based features (e.g., timeouts)
|
||||
- Wrap indefinite waits (`event.wait()`, `stream.receive()`) in `anyio.fail_after(5)` to prevent hangs
|
||||
|
||||
- For commits fixing bugs or adding features based on user reports add:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue