optimizations, more comfortable PromiseFactory api and support virtual threaded executors

This commit is contained in:
WhatCats
2025-01-06 14:06:39 +01:00
parent 18d334a530
commit 9e392c91ba
39 changed files with 1205 additions and 833 deletions

View File

@@ -22,12 +22,16 @@ public class PromiseCompletion<T> {
this.result = null;
}
public boolean isSuccess() {
return exception == null;
}
public boolean isError() {
return getException() != null;
return exception != null;
}
public boolean wasCanceled() {
return getException() instanceof CancellationException;
return exception instanceof CancellationException;
}
public @Nullable T getResult() {