Class SoundTaskExecutor


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

      Constructors 
      Constructor Description
      SoundTaskExecutor()
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(@NotNull java.lang.Runnable task)
      Schedules a task for execution.
      void executeAndWait​(@NotNull java.lang.Runnable task)
      Schedules a task for execution.
      void start()
      Activates this instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SoundTaskExecutor

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

      • start

        public void start()
        Activates this instance.
      • execute

        public void execute​(@NotNull
                            @NotNull java.lang.Runnable task)
        Schedules a task for execution. The task must not block as all tasks are executed in the same thread.
        Parameters:
        task - the task
      • executeAndWait

        public void executeAndWait​(@NotNull
                                   @NotNull java.lang.Runnable task)
                            throws java.lang.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:
        java.lang.InterruptedException - if the current thread was interrupted while waiting for the shutdown