Interface Async<T>

All Superinterfaces:
Consumer<T>, Supplier<T>
All Known Implementing Classes:
Async.Completed, Async.Uncompleted

public interface Async<T> extends Supplier<T>, Consumer<T>
Упрощенная версия Future, для максимальной производительности
Author:
whilein
  • Method Details

    • completed

      @NotNull static <T> @NotNull Async<T> completed(T value)
    • uncompleted

      @NotNull static <T> @NotNull Async<T> uncompleted()
    • supply

      @NotNull static <T> @NotNull Async<T> supply(@NotNull @NotNull Supplier<T> supplier)
    • supply

      @NotNull static <T> @NotNull Async<T> supply(@NotNull @NotNull Supplier<T> supplier, @NotNull @NotNull Executor executor)
    • addListener

      void addListener(@NotNull @NotNull Consumer<T> listener)
    • complete

      void complete(T value)
    • accept

      default void accept(T value)
      Specified by:
      accept in interface Consumer<T>
    • get

      T get(long millis, int nanos)
    • get

      T get(long millis)