Enum Class ExecutorHelper

java.lang.Object
java.lang.Enum<ExecutorHelper>
org.smallibs.concurrent.execution.ExecutorHelper
All Implemented Interfaces:
Serializable, Comparable<ExecutorHelper>, java.lang.constant.Constable

public enum ExecutorHelper extends Enum<ExecutorHelper>
Asynchronous execution builder
  • Method Details

    • values

      public static ExecutorHelper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ExecutorHelper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • create

      public static Executor create(ExecutorService executorService)
      Factory
      Parameters:
      executorService - The underlying executor service
      Returns:
      a new executor
    • await

      public static <T> Try<T> await(Promise<T> promise, java.time.Duration duration)
      Await method
      Type Parameters:
      T - The promised value type
      Parameters:
      promise - The promise to await for
      duration - The wait duration before timeout
      Returns:
      a result or a failure