add more direct listener methods

This commit is contained in:
WhatCats
2024-05-25 21:17:14 +02:00
parent 363669d2c6
commit 4251f2fd82
2 changed files with 62 additions and 0 deletions

View File

@@ -19,6 +19,16 @@ public interface Promise<T> {
PromiseFactory getFactory();
@NotNull Promise<Void> thenRun(@NotNull ExceptionalRunnable task);
@NotNull Promise<Void> thenConsume(@NotNull ExceptionalConsumer<T> task);
<V> @NotNull Promise<V> thenSupply(@NotNull ExceptionalSupplier<V> task);
<V> @NotNull Promise<V> thenApply(@NotNull ExceptionalFunction<T, V> task);
<V> @NotNull Promise<V> thenCompose(@NotNull ExceptionalFunction<T, Promise<V>> task);
@NotNull Promise<Void> thenRunSync(@NotNull ExceptionalRunnable task);
@NotNull Promise<Void> thenRunDelayedSync(@NotNull ExceptionalRunnable task, long delay, @NotNull TimeUnit unit);