> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Type Alias Nemo Relay Native Async Stream Middleware Cb

> Incremental native LLM stream intercept callback.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`.

<pre />

Incremental native LLM stream intercept callback.

The callback owns `next` and `stream` and must release each exactly once. It may push chunks before returning or retain the handles and return `Pending`; no implicit timeout is applied. Relay can invoke separate middleware calls concurrently without stable OS-thread affinity. Retained handles may be used from a plugin-owned thread, while callbacks supplied to `async_next_invoke_stream` run on a Relay runtime worker. The output stream owns the callback lifetime: `next` may be invoked repeatedly or concurrently until that stream finishes, rejects, or is cancelled, and each invocation has independent callback state. Relay rejects or cancels unfinished and later invocations after settlement. The plugin must synchronize shared `user_data` and callback state and serialize each handle's final release after its last operation returns.