Class VirtualThreadTask<V>
java.lang.Object
dev.pfaff.altargui.async.VirtualThreadTask<V>
- All Implemented Interfaces:
Task<V>
,AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
"Closes" the task.boolean
isAlive()
boolean
If this method returnstrue
, thenTask.join()
and friends are guaranteed not to block.join()
static VirtualThreadTask
<Void> spawnVirtualTask
(FallibleRunnable runnable) static <V> VirtualThreadTask
<V> spawnVirtualTask
(Callable<V> callable) thread()
-
Method Details
-
spawnVirtualTask
-
spawnVirtualTask
-
join
- Specified by:
join
in interfaceTask<V>
- Throws:
CompletionException
CancellationException
InterruptedException
-
joinUninterruptibly
- Specified by:
joinUninterruptibly
in interfaceTask<V>
- Throws:
CompletionException
CancellationException
-
isCompleted
public boolean isCompleted()Description copied from interface:Task
If this method returnstrue
, thenTask.join()
and friends are guaranteed not to block.- Specified by:
isCompleted
in interfaceTask<V>
-
close
-
isAlive
public boolean isAlive() -
thread
-