Interface SpeculativeRequestExecutionPolicy

  • All Known Implementing Classes:
    DefaultSpeculativeRequestExecutionPolicy

    public interface SpeculativeRequestExecutionPolicy
    Define a policy for speculative request execution.

    The implementation can define its execution policy. For example, when to issue speculative requests and how many speculative requests to issue.

    Since:
    4.5
    • Method Detail

      • initiateSpeculativeRequest

        java.util.concurrent.ScheduledFuture<?> initiateSpeculativeRequest​(java.util.concurrent.ScheduledExecutorService scheduler,
                                                                           SpeculativeRequestExecutor requestExecutor)
        Initialize the speculative request execution policy and initiate requests.
        Parameters:
        scheduler - The scheduler service to issue the speculative request
        requestExecutor - The executor is used to issue the actual speculative requests
        Returns:
        ScheduledFuture, in case caller needs to cancel it.