direct listeners concept

This commit is contained in:
WhatCats
2024-04-07 11:57:53 +02:00
parent 8ba023c04a
commit c2e4e8c522
9 changed files with 169 additions and 112 deletions

View File

@@ -9,29 +9,17 @@ public class PromiseCompletion<T> {
private @Nullable T result;
private @Nullable Throwable exception;
private boolean active;
public PromiseCompletion(@Nullable T result) {
this.result = result;
this.active = true;
}
public PromiseCompletion(@NotNull Throwable exception) {
this.exception = exception;
this.active = true;
}
public PromiseCompletion() {
this.result = null;
this.active = true;
}
public void markHandled() {
this.active = false;
}
public boolean isActive() {
return active;
}
public boolean isError() {