Class ThreadPoolContext

    • Constructor Detail

      • ThreadPoolContext

        public ThreadPoolContext​(ScheduledExecutorService parent)
        Creates a new thread pool context.
        Parameters:
        parent - The thread pool on which to execute events.
    • Method Detail

      • execute

        public void execute​(Runnable command)
      • schedule

        public Scheduled schedule​(Duration delay,
                                  Runnable runnable)
        Description copied from interface: Scheduler
        Schedules a runnable after a delay.
        Parameters:
        delay - the delay after which to run the callback
        runnable - the callback to run
        Returns:
        the scheduled callback
      • schedule

        public Scheduled schedule​(Duration delay,
                                  Duration interval,
                                  Runnable runnable)
        Description copied from interface: Scheduler
        Schedules a runnable at a fixed rate.
        Parameters:
        delay - the initial delay
        interval - the interval at which to run the callback
        runnable - the callback to run
        Returns:
        the scheduled callback
      • close

        public void close()
        Description copied from interface: ThreadContext
        Closes the context.