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 aForkJoinPool
to schedule fiber execution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.concurrent.Executor
getExecutor()
protected co.paralleluniverse.fibers.FibersMonitor
getMonitor()
java.lang.String
getName()
protected abstract int
getQueueLength()
protected abstract boolean
isCurrentThreadInScheduler()
<T> Fiber<T>
newFiber(SuspendableCallable<T> target)
Strand
newStrand(SuspendableCallable<?> target)
void
shutdown()
-
-
-
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:
newFiber
in interfaceFiberFactory
-
newStrand
public Strand newStrand(SuspendableCallable<?> target)
- Specified by:
newStrand
in interfaceStrandFactory
-
getQueueLength
protected abstract int getQueueLength()
-
isCurrentThreadInScheduler
protected abstract boolean isCurrentThreadInScheduler()
-
getExecutor
public abstract java.util.concurrent.Executor getExecutor()
-
-