Interface RequestExecution
public interface RequestExecution
A live handle to a running
RequestExecutionEngine send. Returned by
RequestExecutionEngine.sendAll() immediately, before the run has finished, so a
long-running send never blocks the caller. The same handle is passed to a
ResponseHandler for each completed request, so a handler can react to the run it is
part of.
Use it to queue follow-up requests into the run, read live
progress via stats(), and control or await the run via its lifetime().
-
Method Summary
Modifier and TypeMethodDescriptionlifetime()voidqueue(HttpRequest request) Queue another request into this run, with no correlation label.voidqueue(HttpRequest request, String label) Queue another request into this run, tagged with a correlation label echoed back on itsRequestResult.label().stats()
-
Method Details
-
queue
Queue another request into this run, with no correlation label. Equivalent toqueue(request, ""). Queuing keeps the run alive, so aResponseHandlerthat queues follow-ups extends the run, which drains naturally once queuing stops.- Parameters:
request- The full HTTP request to send.
-
queue
Queue another request into this run, tagged with a correlation label echoed back on itsRequestResult.label().- Parameters:
request- The full HTTP request to send.label- A correlation label;nullis treated as"".
-
stats
ExecutionStats stats()- Returns:
- A live snapshot of the run's progress.
-
lifetime
RequestExecutionLifetime lifetime()- Returns:
- The run's lifetime - pause, resume, cancel, and await or be notified of completion.
-