org.jetlang.fibers
Class PoolFiberFactory

java.lang.Object
  extended by org.jetlang.fibers.PoolFiberFactory
All Implemented Interfaces:
Disposable

public class PoolFiberFactory
extends java.lang.Object
implements Disposable

Factory that creates Fiber instances that share threads.


Constructor Summary
PoolFiberFactory(java.util.concurrent.Executor executor)
          Construct a new instance.
 
Method Summary
 Fiber create()
          Create a new Fiber from this pool.
 Fiber create(BatchExecutor batchExecutor)
          Create a new Fiber from this pool that uses the supplied Executor to execute commands
 void dispose()
          Dispose this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolFiberFactory

public PoolFiberFactory(java.util.concurrent.Executor executor)
Construct a new instance.

Parameters:
executor - Executor to use for flushing pending commands for each created Fiber
Method Detail

create

public Fiber create()
Create a new Fiber from this pool. Equivalent to calling create(BatchExecutor) with a SynchronousExecutor

Returns:
Fiber instance

create

public Fiber create(BatchExecutor batchExecutor)
Create a new Fiber from this pool that uses the supplied Executor to execute commands

Parameters:
batchExecutor - Executor to use for command executor. Required.
Returns:
Fiber instance

dispose

public void dispose()
Description copied from interface: Disposable
Dispose this instance. It should be considered unusable after calling this method

Specified by:
dispose in interface Disposable


Copyright © 2009. All Rights Reserved.