From bac416306831bf7dd0450237c8b85a73b7c951f6 Mon Sep 17 00:00:00 2001 From: ishland Date: Mon, 5 Aug 2024 23:19:31 +0800 Subject: [PATCH] change: expose internal futures --- .../java/com/ishland/flowsched/scheduler/ItemHolder.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/ishland/flowsched/scheduler/ItemHolder.java b/src/main/java/com/ishland/flowsched/scheduler/ItemHolder.java index 67ff3a3..9c1caf5 100644 --- a/src/main/java/com/ishland/flowsched/scheduler/ItemHolder.java +++ b/src/main/java/com/ishland/flowsched/scheduler/ItemHolder.java @@ -256,6 +256,13 @@ public K getKey() { public synchronized CompletableFuture getFutureForStatus(ItemStatus status) { return this.futures[status.ordinal()].thenApply(Function.identity()); } + + /** + * Only for trusted methods + */ + public synchronized CompletableFuture getFutureForStatus0(ItemStatus status) { + return this.futures[status.ordinal()]; + } public AtomicReference getItem() { return this.item;