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 PostRequestMetricsSupportcreate()Creates a new instance.static voidrecordPostProcessingWork(ServerRequest request, BiConsumer<ServerResponse, Throwable> task) Records a post-processing task to be performed once the response has been sent to the client.voidRecords post-request processing to be performed once the server sends the response to the client.voidrunTasks(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-ServerRequestwith 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- theServerRequestfrom the clientresponse- theServerResponsealready sent to the clientthrowable- theThrowablefor any problem encountered in preparing the response; null if successful
-