Class FutureAlgoResponse

  • All Implemented Interfaces:
    java.util.concurrent.Future<AlgoResponse>

    public class FutureAlgoResponse
    extends java.lang.Object
    implements java.util.concurrent.Future<AlgoResponse>
    A request object to represent that an algorithm has been call asynchronously Wrapping Future<AlgoResponse> will allow other async scenarios (e.g. where the internal implementation is based on polling instead of long-lived connections) without changing the exposed interface
    • Field Detail

      • promise

        protected java.util.concurrent.Future<AlgoResponse> promise
    • Constructor Detail

      • FutureAlgoResponse

        protected FutureAlgoResponse()
      • FutureAlgoResponse

        public FutureAlgoResponse​(java.util.concurrent.Future<AlgoResponse> promise)
    • Method Detail

      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<AlgoResponse>
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<AlgoResponse>
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<AlgoResponse>
      • get

        public AlgoResponse get()
                         throws java.lang.InterruptedException,
                                java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<AlgoResponse>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public AlgoResponse get​(long timeout,
                                java.util.concurrent.TimeUnit unit)
                         throws java.lang.InterruptedException,
                                java.util.concurrent.ExecutionException,
                                java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<AlgoResponse>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException