Skip to main content

Module emit

Module emit 

Source
Expand description

RequestEvent construction and emission.

The sole construction site for RequestEvent. handle_request calls emit once, immediately after the response chain has finished, before IntoResponse converts the value to an axum response.

mcpr-cloud/backend/ consumes RequestEvent and session-lifecycle events — the inline tests below cover the field shapes both rely on.

Functions§

build_request_event
Build a RequestEvent from the accumulated context and the final response. Separated from emit so it can be unit-tested without a live event bus.
emit
Emit a Request event to the proxy’s event bus. Called once per request, after the response chain.
normalize_platform
Normalize a client name to a platform identifier used in SessionStart. Thin re-export of pipeline::middlewares::shared::normalize_platform so external callers of this module don’t have to reach into the middlewares submodule.