Package co.paralleluniverse.fibers.io
Class ChannelGroup
- java.lang.Object
- 
- co.paralleluniverse.fibers.io.ChannelGroup
 
- 
 public abstract class ChannelGroup extends java.lang.ObjectA grouping of channels for the purpose of resource sharing.A channel group encapsulates the mechanics required to handle the completion of I/O operations initiated by channels that are bound to the group. A group has an associated thread pool which polls IO events sent by the OS. 
- 
- 
Constructor SummaryConstructors Constructor Description ChannelGroup()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidshutdown()Shutdown the channel group.static ChannelGroupwithFixedThreadPool(int nThreads, java.util.concurrent.ThreadFactory threadFactory)Creates a channel group with a fixed thread pool.static ChannelGroupwithThreadPool(java.util.concurrent.ExecutorService executor)Creates a channel group with a given thread pool.
 
- 
- 
- 
Method Detail- 
withFixedThreadPoolpublic static ChannelGroup withFixedThreadPool(int nThreads, java.util.concurrent.ThreadFactory threadFactory) throws java.io.IOException Creates a channel group with a fixed thread pool.The resulting channel group reuses a fixed number of threads. At any point, at most nThreadsthreads will be active processing tasks that are submitted to handle I/O events and dispatch completion results for operations initiated on channels in the group.- Parameters:
- nThreads- The number of threads in the pool
- threadFactory- The factory to use when creating new threads
- Returns:
- A new asynchronous channel group
- Throws:
- java.lang.IllegalArgumentException- If- nThreads <= 0
- java.io.IOException- If an I/O error occurs
 
 - 
withThreadPoolpublic static ChannelGroup withThreadPool(java.util.concurrent.ExecutorService executor) throws java.io.IOException Creates a channel group with a given thread pool.- Parameters:
- executor- The thread pool for the resulting group
- Returns:
- A new asynchronous channel group
- Throws:
- java.io.IOException
 
 - 
shutdownpublic abstract void shutdown() Shutdown the channel group.
 
- 
 
-