Package co.paralleluniverse.fibers
Class FiberScheduler
- java.lang.Object
-
- co.paralleluniverse.fibers.FiberScheduler
-
- All Implemented Interfaces:
FiberFactory,StrandFactory
- Direct Known Subclasses:
FiberExecutorScheduler,FiberForkJoinScheduler
public abstract class FiberScheduler extends java.lang.Object implements FiberFactory, StrandFactory
A thread-pool based scheduler for fibers. Internally, this scheduler uses aForkJoinPoolto schedule fiber execution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.concurrent.ExecutorgetExecutor()protected co.paralleluniverse.fibers.FibersMonitorgetMonitor()java.lang.StringgetName()protected abstract intgetQueueLength()protected abstract booleanisCurrentThreadInScheduler()<T> Fiber<T>newFiber(SuspendableCallable<T> target)StrandnewStrand(SuspendableCallable<?> target)voidshutdown()
-
-
-
Method Detail
-
shutdown
public void shutdown()
-
getName
public java.lang.String getName()
-
getMonitor
protected co.paralleluniverse.fibers.FibersMonitor getMonitor()
-
newFiber
public <T> Fiber<T> newFiber(SuspendableCallable<T> target)
- Specified by:
newFiberin interfaceFiberFactory
-
newStrand
public Strand newStrand(SuspendableCallable<?> target)
- Specified by:
newStrandin interfaceStrandFactory
-
getQueueLength
protected abstract int getQueueLength()
-
isCurrentThreadInScheduler
protected abstract boolean isCurrentThreadInScheduler()
-
getExecutor
public abstract java.util.concurrent.Executor getExecutor()
-
-