Class FiberExecutorScheduler

  • All Implemented Interfaces:
    FiberFactory, StrandFactory, java.util.concurrent.Executor

    public class FiberExecutorScheduler
    extends FiberScheduler
    implements java.util.concurrent.Executor
    A fiber scheduler that uses a given Executor for scheduling. The Runnable tasks passed to the Executor for execution, implement the FiberSchedulerTask interface.
    • Constructor Detail

      • FiberExecutorScheduler

        public FiberExecutorScheduler​(java.lang.String name,
                                      java.util.concurrent.Executor executor,
                                      co.paralleluniverse.common.monitoring.MonitorType monitorType,
                                      boolean detailedInfo)
        Creates a new fiber scheduler.
        Parameters:
        name - the scheuler's name. This name is used in naming the scheduler's threads.
        executor - an Executor used to schedule the fibers; may be null if the execute(Runnable) method is overriden.
        monitorType - the MonitorType type to use for the scheduler.
        detailedInfo - whether detailed information about the fibers is collected by the fibers monitor.
      • FiberExecutorScheduler

        public FiberExecutorScheduler​(java.lang.String name,
                                      java.util.concurrent.Executor executor)
        Creates a new fiber scheduler with no monitor.
        Parameters:
        name - the scheuler's name. This name is used in naming the scheduler's threads.
        executor - an Executor used to schedule the fibers; may be null if the execute(Runnable) method is overriden.
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor
      • getRunningFibers

        protected java.util.Map<java.lang.Thread,​Fiber> getRunningFibers()