Interface AsyncConsumer<T>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface AsyncConsumer<T>
    Represents an asynchronous consumer that consumes data items.
    • Method Detail

      • accept

        @NotNull
        @NotNull Promise<Void> accept​(T value)
        Consumes some data asynchronously.
        Parameters:
        value - value to be consumed
        Returns:
        Promise of Void that represents successful consumption of data
      • transformWith

        @Contract(pure=true)
        @NotNull
        default <R> R transformWith​(@NotNull
                                    @NotNull Function<AsyncConsumer<T>,​R> fn)
      • async

        @Contract(pure=true)
        @NotNull
        default @NotNull AsyncConsumer<T> async()
      • withExecutor

        @Contract(pure=true)
        @NotNull
        default @NotNull AsyncConsumer<T> withExecutor​(@NotNull
                                                       @NotNull AsyncExecutor asyncExecutor)
      • peek

        @Contract(pure=true)
        @NotNull
        default @NotNull AsyncConsumer<T> peek​(@NotNull
                                               @NotNull Consumer<T> action)
      • map

        @Contract(pure=true)
        @NotNull
        default <V> @NotNull AsyncConsumer<V> map​(@NotNull
                                                  @NotNull Function<? super V,​? extends T> fn)
      • mapAsync

        @Contract(pure=true)
        @NotNull
        default <V> @NotNull AsyncConsumer<V> mapAsync​(@NotNull
                                                       @NotNull Function<? super V,​? extends Promise<T>> fn)