Skip to content

Commit d0683ef

Browse files
committed
update README.md
1 parent 7d15d72 commit d0683ef

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ Returns `True` if the `KafkaConcurrentHandler` stored in `context` is running an
126126

127127
FastStream middleware class. Pass it to `KafkaBroker(middlewares=[...])`, `broker.add_middleware(...)`, or scope it to a subset of subscribers via `KafkaRouter`. See Quick Start for usage examples.
128128

129+
> **Must be listed first** in any middleware list. `consume_scope` fires the handler as a background task and returns `None` immediately — any middleware wrapping it on the outside would see that premature return and misfire (wrong timing, missed exceptions, early cleanup). Middlewares listed after it run correctly inside the background task.
130+
129131
## How It Works
130132

131133
1. **Message dispatch**: On each incoming message, `consume_scope` calls `handle_task()`, which acquires a semaphore slot then fires the handler coroutine as a background `asyncio.Task`.

0 commit comments

Comments
 (0)