This commit is contained in:
Tommy
2023-12-12 13:05:35 +00:00
parent d36cc80c15
commit 4db601bc21

View File

@@ -194,13 +194,18 @@ public class Promise<T> {
}, Schedulers.getTrace(task)); }, Schedulers.getTrace(task));
} }
public @NotNull Promise<Void> thenConsumerDelayedAsync(@NotNull ExceptionalConsumer<T> task, long delay, @NotNull TimeUnit unit) { public @NotNull Promise<Void> thenConsumeDelayedAsync(@NotNull ExceptionalConsumer<T> task, long delay, @NotNull TimeUnit unit) {
return thenApplyDelayedAsync(result -> { return thenApplyDelayedAsync(result -> {
task.accept(result); task.accept(result);
return null; return null;
}, delay, unit, Schedulers.getTrace(task)); }, delay, unit, Schedulers.getTrace(task));
} }
@Deprecated(forRemoval = true)
public @NotNull Promise<Void> thenConsumerDelayedAsync(@NotNull ExceptionalConsumer<T> task, long delay, @NotNull TimeUnit unit) {
return thenConsumeDelayedAsync(task, delay, unit);
}
public <V> @NotNull Promise<V> thenSupplyAsync(@NotNull ExceptionalSupplier<V> task) { public <V> @NotNull Promise<V> thenSupplyAsync(@NotNull ExceptionalSupplier<V> task) {
return thenApplyAsync(result -> task.get(), Schedulers.getTrace(task)); return thenApplyAsync(result -> task.get(), Schedulers.getTrace(task));
} }