Class ExecutorScheduler.ExecutorWorker

    • Field Detail

      • interruptibleWorker

        final boolean interruptibleWorker
      • fair

        final boolean fair
      • executor

        final java.util.concurrent.Executor executor
      • disposed

        volatile boolean disposed
      • wip

        final java.util.concurrent.atomic.AtomicInteger wip
    • Constructor Detail

      • ExecutorWorker

        public ExecutorWorker​(java.util.concurrent.Executor executor,
                              boolean interruptibleWorker,
                              boolean fair)
    • Method Detail

      • schedule

        @NonNull
        public @NonNull Disposable schedule​(@NonNull
                                            @NonNull java.lang.Runnable run,
                                            long delay,
                                            @NonNull
                                            @NonNull java.util.concurrent.TimeUnit unit)
        Description copied from class: Scheduler.Worker
        Schedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.

        Note to implementors: non-positive delayTime should be regarded as non-delayed schedule, i.e., as if the Scheduler.Worker.schedule(Runnable) was called.

        Specified by:
        schedule in class Scheduler.Worker
        Parameters:
        run - the Runnable to schedule
        delay - time to "wait" before executing the action; non-positive values indicate an non-delayed schedule
        unit - the time unit of delayTime
        Returns:
        a Disposable to be able to unsubscribe the action (cancel it if not executed)
      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Dispose the resource, the operation should be idempotent.
        Specified by:
        dispose in interface Disposable
      • isDisposed

        public boolean isDisposed()
        Description copied from interface: Disposable
        Returns true if this resource has been disposed.
        Specified by:
        isDisposed in interface Disposable
        Returns:
        true if this resource has been disposed
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • runFair

        void runFair()
      • runEager

        void runEager()