A {@link ThreadPoolExecutor} which blocks the task submission when there'stoo many tasks in the queue.
Both per- {@link Channel} and per-{@link Executor} limitation can be applied.If the total size of the unprocessed tasks (i.e. {@link Runnable}s) exceeds either per- {@link Channel} or per-{@link Executor} threshold, any further{@link #execute(Runnable)} call will block until the tasks in the queueare processed so that the total size goes under the threshold.
{@link ObjectSizeEstimator} is used to calculate the size of each task.
Please note that this executor does not maintain the order of the {@link ChannelEvent}s for the same {@link Channel}. For example, you can even receive a {@code "channelClosed"} event before a{@code "messageReceived"} event, as depicted by the following diagram.For example, the events can be processed as depicted below:
--------------------------------> Timeline --------------------------------> Thread X: --- Channel A (Event 2) --- Channel A (Event 1) ---------------------------> Thread Y: --- Channel A (Event 3) --- Channel B (Event 2) --- Channel B (Event 3) ---> Thread Z: --- Channel B (Event 1) --- Channel B (Event 4) --- Channel A (Event 4) --->
To maintain the event order, you must use {@link OrderedMemoryAwareThreadPoolExecutor}.
@author The Netty Project (netty-dev@lists.jboss.org)
@author Trustin Lee (tlee@redhat.com)
@version $Rev: 1011 $, $Date: 2009-03-11 20:22:06 +0900 (Wed, 11 Mar 2009) $
@apiviz.uses org.jboss.netty.handler.execution.ObjectSizeEstimator
@apiviz.uses org.jboss.netty.handler.execution.ChannelEventRunnable