Package com.jsgalactic.axiom.context
Interface StreamingHandler
- All Superinterfaces:
Handler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Marks a handler that reads its request body incrementally through
Context.bodyReader().
Registration with this type opts the route into the streaming body path: the runtime hands the
handler the reader as soon as the request head is accepted, without buffering the body first, and
pauses reading the connection when the handler falls behind. A handler that does not implement
this interface keeps the buffered body path, where Request.body() is complete before the handler runs.
A streaming handler's request has no buffered body: it must read the reader instead of calling
Context.body(Class) or Request.body(). It must read to
the end of the body or call BodyReader.close() when it stops
early; the runtime closes any reader the handler leaves open when the exchange ends. Middleware
on a streaming route sees the same restriction, including error handlers.
-
Method Summary