Class OortObject.Result.Deferred<D>

    • Constructor Detail

      • Deferred

        public Deferred()
    • Method Detail

      • onResult

        public void onResult​(D result)
        Description copied from interface: OortObject.Result

        Callback method invoked when the result is available.

        Specified by:
        onResult in interface OortObject.Result<D>
        result - the result object
      • get

        public D get​(long time,
                     TimeUnit unit)
              throws InterruptedException,

        Waits for the result to be available for the specified amount of time.

        If the wait time elapses, a TimeoutException is thrown, but this method can be called again to wait more time for the result.

        time - the maximum time to wait
        unit - the time unit
        the result if available, otherwise an exception is thrown
        InterruptedException - if the thread is interrupted while waiting
        TimeoutException - if the time elapses before the result is available