Interface TaskExecutorImpl

All Superinterfaces:
Executor, dev.engine_room.flywheel.api.task.TaskExecutor
All Known Implementing Classes:
ParallelTaskExecutor, SerialTaskExecutor

public interface TaskExecutorImpl extends dev.engine_room.flywheel.api.task.TaskExecutor
  • Method Details

    • syncUntil

      boolean syncUntil(BooleanSupplier cond)
      Wait for running tasks, until the given condition is met (BooleanSupplier.getAsBoolean() returns true).
      This method is equivalent to syncWhile(() -> !cond.getAsBoolean()).
      Parameters:
      cond - The condition to wait for.
      Returns:
      true if the condition is met. false if this executor runs out of tasks before the condition is met.
    • syncWhile

      boolean syncWhile(BooleanSupplier cond)
      Wait for running tasks, so long as the given condition is met (BooleanSupplier.getAsBoolean() returns true).
      If this method is called on the
      This method is equivalent to syncUntil(() -> !cond.getAsBoolean()).
      Parameters:
      cond - The condition sync on.
      Returns:
      true if the condition is no longer met. false if this executor runs out of tasks while the condition is still met.
    • syncPoint

      void syncPoint()
      Wait for all running tasks to finish.
      This is useful as a nuclear option, but most of the time you should try to use syncUntil.