diff --git a/futur-api/src/main/java/dev/tommyjs/futur/promise/Promise.java b/futur-api/src/main/java/dev/tommyjs/futur/promise/Promise.java index c8fb4b3..92f8a4d 100644 --- a/futur-api/src/main/java/dev/tommyjs/futur/promise/Promise.java +++ b/futur-api/src/main/java/dev/tommyjs/futur/promise/Promise.java @@ -89,14 +89,14 @@ public class Promise { }, delay, unit, Schedulers.getTrace(task)); } - public @NotNull Promise thenAcceptSync(@NotNull ExceptionalConsumer task) { + public @NotNull Promise thenConsumeSync(@NotNull ExceptionalConsumer task) { return thenApplySync(result -> { task.accept(result); return null; }, Schedulers.getTrace(task)); } - public @NotNull Promise thenAcceptDelayedSync(@NotNull ExceptionalConsumer task, long delay, @NotNull TimeUnit unit) { + public @NotNull Promise thenConsumeDelayedSync(@NotNull ExceptionalConsumer task, long delay, @NotNull TimeUnit unit) { return thenApplyDelayedSync(result -> { task.accept(result); return null; @@ -153,7 +153,7 @@ public class Promise { public @NotNull Promise thenComposeSync(@NotNull ExceptionalFunction> task) { Promise promise = new Promise<>(); - thenApplySync(task, Schedulers.getTrace(task)).thenAcceptAsync(nestedPromise -> { + thenApplySync(task, Schedulers.getTrace(task)).thenConsumeAsync(nestedPromise -> { nestedPromise.addListener(ctx1 -> { if (ctx1.isError()) { //noinspection ConstantConditions @@ -187,14 +187,14 @@ public class Promise { }, delay, unit, Schedulers.getTrace(task)); } - public @NotNull Promise thenAcceptAsync(@NotNull ExceptionalConsumer task) { + public @NotNull Promise thenConsumeAsync(@NotNull ExceptionalConsumer task) { return thenApplyAsync(result -> { task.accept(result); return null; }, Schedulers.getTrace(task)); } - public @NotNull Promise thenAcceptDelayedAsync(@NotNull ExceptionalConsumer task, long delay, @NotNull TimeUnit unit) { + public @NotNull Promise thenConsumerDelayedAsync(@NotNull ExceptionalConsumer task, long delay, @NotNull TimeUnit unit) { return thenApplyDelayedAsync(result -> { task.accept(result); return null; @@ -249,7 +249,7 @@ public class Promise { public @NotNull Promise thenComposeAsync(@NotNull ExceptionalFunction> task) { Promise promise = new Promise<>(); - thenApplyAsync(task, Schedulers.getTrace(task)).thenAcceptAsync(nestedPromise -> { + thenApplyAsync(task, Schedulers.getTrace(task)).thenConsumeAsync(nestedPromise -> { nestedPromise.addListener(ctx1 -> { if (ctx1.isError()) { //noinspection ConstantConditions