Interface AsyncResult<T>

Type Parameters:
T - result type

public interface AsyncResult<T>
Future-like handle for asynchronous workload or invocation results.
  • Method Summary

    Modifier and Type
    Method
    Description
    await(Duration timeout)
    Waits for completion up to the timeout.
    void
    Requests best-effort cancellation.
    boolean
    Returns whether the result is complete.
    ref()
    Returns the task reference.
  • Method Details

    • ref

      TaskRef ref()
      Returns the task reference.
      Returns:
      task reference
    • await

      T await(Duration timeout)
      Waits for completion up to the timeout.
      Parameters:
      timeout - maximum wait
      Returns:
      result value
    • cancel

      void cancel()
      Requests best-effort cancellation.
    • done

      boolean done()
      Returns whether the result is complete.
      Returns:
      whether the result is complete