HttpKernel class final
Orchestrates the request lifecycle (BLUEPRINT_V2 §5.4): global middleware → routing → route middleware → handler → response conversion, with exception rendering at both the route and global layers, per-route timeouts and a terminate phase after the response is sent.
Constructors
- HttpKernel({required Router router, required MiddlewareRegistry middleware, required ExceptionHandler exceptions, Logger? logger})
Properties
- defaultTimeout ↔ Duration?
-
Default handler timeout applied when a route sets none (
null= none).getter/setter pair - exceptions → ExceptionHandler
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → Logger?
-
final
- middleware → MiddlewareRegistry
-
final
- router → Router
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
unmatched
↔ Future<
Response> Function(Request request)? -
Answers requests no route matches, for any method, instead of the
404 or 405 (
withUpstream: the strangler fig proxy). The global middleware still applies; route middleware, of course, does not.getter/setter pair
Methods
-
handle(
Request request) → Future< Response> - Handles a single request and always yields a response.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
terminate(
Request request, Response response) → Future< void> -
Runs
terminate()of every terminable middleware that applied to the request plus the callbacks registered with Request.defer. Errors are reported and never propagate. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
toResponse(
Object? result, Request request) → Response - Converts a handler result into a Response.