Class Async
java.lang.Object
megalodonte.base.async.Async
Utility for running tasks on virtual threads. Uses a
newVirtualThreadPerTaskExecutor — each submitted task gets its own
virtual thread.
This is fire-and-forget: unhandled exceptions go to ErrorReporter,
there is no result callback and no handle to cancel. For work that opens
a resource needing symmetric teardown, use Scope instead.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidRun(RunnableThrowing task) Submits a task to run on a virtual thread.
-
Method Details
-
Run
Submits a task to run on a virtual thread. Exceptions are caught and forwarded toErrorReporter.handle(Throwable).- Parameters:
task- the task to execute
-