Interface TaskExecutorService

  • All Superinterfaces:
    java.util.concurrent.Executor, java.util.concurrent.ExecutorService, java.util.concurrent.ScheduledExecutorService

    public interface TaskExecutorService
    extends java.util.concurrent.ScheduledExecutorService
    A delegating ExecutorService that schedules all its tasks on Sponge's Scheduler.

    This class can be used to allow any libraries that support the standard concurrency interface to schedule their asynchronous tasks through Sponge.

    • Method Detail

      • submit

        <T> TaskFuture<T> submit​(java.util.concurrent.Callable<T> task)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • submit

        TaskFuture<?> submit​(java.lang.Runnable task)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • submit

        <T> TaskFuture<T> submit​(java.lang.Runnable task,
                                 @Nullable T result)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • schedule

        ScheduledTaskFuture<?> schedule​(java.lang.Runnable command,
                                        long delay,
                                        java.time.temporal.TemporalUnit unit)
      • schedule

        ScheduledTaskFuture<?> schedule​(java.lang.Runnable command,
                                        long delay,
                                        java.util.concurrent.TimeUnit unit)
        Specified by:
        schedule in interface java.util.concurrent.ScheduledExecutorService
      • schedule

        <V> ScheduledTaskFuture<V> schedule​(java.util.concurrent.Callable<V> callable,
                                            long delay,
                                            java.time.temporal.TemporalUnit unit)
      • schedule

        <V> ScheduledTaskFuture<V> schedule​(java.util.concurrent.Callable<V> callable,
                                            long delay,
                                            java.util.concurrent.TimeUnit unit)
        Specified by:
        schedule in interface java.util.concurrent.ScheduledExecutorService
      • scheduleAtFixedRate

        ScheduledTaskFuture<?> scheduleAtFixedRate​(java.lang.Runnable command,
                                                   long initialDelay,
                                                   long period,
                                                   java.time.temporal.TemporalUnit unit)
      • scheduleAtFixedRate

        ScheduledTaskFuture<?> scheduleAtFixedRate​(java.lang.Runnable command,
                                                   long initialDelay,
                                                   long period,
                                                   java.util.concurrent.TimeUnit unit)
        Specified by:
        scheduleAtFixedRate in interface java.util.concurrent.ScheduledExecutorService
      • scheduleWithFixedDelay

        ScheduledTaskFuture<?> scheduleWithFixedDelay​(java.lang.Runnable command,
                                                      long initialDelay,
                                                      long delay,
                                                      java.time.temporal.TemporalUnit unit)
      • scheduleWithFixedDelay

        ScheduledTaskFuture<?> scheduleWithFixedDelay​(java.lang.Runnable command,
                                                      long initialDelay,
                                                      long delay,
                                                      java.util.concurrent.TimeUnit unit)
        Specified by:
        scheduleWithFixedDelay in interface java.util.concurrent.ScheduledExecutorService