Interface ResponseMarshaler.Builder.UnparsedRequestHandler
- Enclosing class:
ResponseMarshaler.Builder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
ResponseMarshaler.forUnparsedRequest(UnparsedRequest).- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionhandle(@NonNull UnparsedRequest request) Prepares a response for incoming bytes rejected before a validRequestcan be constructed.
-
Method Details
-
handle
Prepares a response for incoming bytes rejected before a validRequestcan be constructed.This method is invoked at most once for each rejected request, only if the rejection-detail task is accepted and timeout budget remains after lifecycle observation. Captured bytes are untrusted and may contain sensitive values. The built-in HTTP and SSE transports dispatch it to the configured request-handler executor and never invoke it inline on the selector thread. The framework-managed default executor has bounded concurrency and queue capacity; a custom executor controls its own capacity. The handler should perform bounded work and must not block. The request-handler timeout bounds how long the transport waits; cancellation interrupts the worker but is cooperative if application code ignores interruption. When application capacity or timeout budget is unavailable, the handler may be skipped in favor of a built-in response.
Detailed documentation is available at https://www.soklet.com/docs/response-writing#advanced-response-marshaling.
- Parameters:
request- the rejected unparsed request- Returns:
- the response to be sent over the wire
-