Interface PostRequestMetricsSupport
public interface PostRequestMetricsSupport
Encapsulates metrics-related post-request processing that other components use and factory methods for creating instances of
the related context.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PostRequestMetricsSupport
create()
Creates a new instance.static void
recordPostProcessingWork
(ServerRequest request, BiConsumer<ServerResponse, Throwable> task) Records a post-processing task to be performed once the response has been sent to the client.void
Records post-request processing to be performed once the server sends the response to the client.void
runTasks
(ServerRequest request, ServerResponse response, Throwable throwable) Run the post-processing tasks.
-
Method Details
-
create
Creates a new instance.- Returns:
- new instance
-
recordPostProcessingWork
static void recordPostProcessingWork(ServerRequest request, BiConsumer<ServerResponse, Throwable> task) Records a post-processing task to be performed once the response has been sent to the client.- Parameters:
request
-ServerRequest
with which to associate the post-processing tasktask
- the work to perform
-
registerPostRequestWork
Records post-request processing to be performed once the server sends the response to the client.- Parameters:
task
- the work to perform
-
runTasks
Run the post-processing tasks.- Parameters:
request
- theServerRequest
from the clientresponse
- theServerResponse
already sent to the clientthrowable
- theThrowable
for any problem encountered in preparing the response; null if successful
-