From 31f654544a1abf49fe51fafef1dce0d4fbd53cd4 Mon Sep 17 00:00:00 2001 From: tommyskeff Date: Sun, 19 Nov 2023 21:44:26 +0000 Subject: [PATCH] Correct promise naming convention --- .../main/java/dev/tommyjs/futur/promise/Promise.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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