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 Details

    • queue

      void queue(HttpRequest request)
      Queue another request into this run, with no correlation label. Equivalent to queue(request, ""). Queuing keeps the run alive, so a ResponseHandler that queues follow-ups extends the run, which drains naturally once queuing stops.
      Parameters:
      request - The full HTTP request to send.
    • queue

      void queue(HttpRequest request, String label)
      Queue another request into this run, tagged with a correlation label echoed back on its RequestResult.label().
      Parameters:
      request - The full HTTP request to send.
      label - A correlation label; null is treated as "".
    • stats

      Returns:
      A live snapshot of the run's progress.
    • lifetime

      Returns:
      The run's lifetime - pause, resume, cancel, and await or be notified of completion.