Class SoundTaskExecutor

java.lang.Object
com.realtime.crossfire.jxclient.sound.SoundTaskExecutor

public class SoundTaskExecutor extends Object
Executes non-blocking tasks for sound-related functions. All tasks are executed as fast as possible and from a single thread.
  • Constructor Details

    • SoundTaskExecutor

      public SoundTaskExecutor()
      Creates a new instance.
  • Method Details

    • start

      public void start()
      Activates this instance.
    • execute

      public void execute(@NotNull @NotNull Runnable task)
      Schedules a task for execution. All tasks are executed in the same thread.
      Parameters:
      task - the task
    • executeAndWait

      public void executeAndWait(@NotNull @NotNull Runnable task) throws InterruptedException
      Schedules a task for execution. The task must not block as all tasks are executed in the same thread.
      Parameters:
      task - the task
      Throws:
      InterruptedException - if the current thread was interrupted while waiting for the shutdown