Interface AsyncExecutor

All Superinterfaces:
Executor

public interface AsyncExecutor extends Executor
Virtual threads for a mod's blocking work, such as HTTP calls or file I/O: one thread per task, named zf-async-<id>-<n>. ZomboidForge shuts it down when the server stops; tasks submitted after that are rejected with a RejectedExecutionException.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Runs task on a new virtual thread.
    submit(Callable<T> task)
    Runs task on a new virtual thread; the future completes with its result or exception.
  • Method Details

    • execute

      void execute(Runnable task)
      Runs task on a new virtual thread. An exception it throws is logged with the mod's id.
      Specified by:
      execute in interface Executor
    • submit

      <T> CompletableFuture<T> submit(Callable<T> task)
      Runs task on a new virtual thread; the future completes with its result or exception.