Package com.rabbitmq.client.impl
Class ConsumerWorkService
- java.lang.Object
-
- com.rabbitmq.client.impl.ConsumerWorkService
-
public final class ConsumerWorkService extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classConsumerWorkService.WorkPoolRunnable
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_NUM_THREADSprivate java.util.concurrent.ExecutorServiceexecutorprivate static org.slf4j.LoggerLOGGERprivate static intMAX_RUNNABLE_BLOCK_SIZEprivate booleanprivateExecutorprivate intshutdownTimeoutprivate WorkPool<Channel,java.lang.Runnable>workPool
-
Constructor Summary
Constructors Constructor Description ConsumerWorkService(java.util.concurrent.ExecutorService executor, java.util.concurrent.ThreadFactory threadFactory, int shutdownTimeout)ConsumerWorkService(java.util.concurrent.ExecutorService executor, java.util.concurrent.ThreadFactory threadFactory, int queueingTimeout, int shutdownTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWork(Channel channel, java.lang.Runnable runnable)intgetShutdownTimeout()voidregisterKey(Channel channel)voidsetUnlimited(Channel channel, boolean unlimited)voidshutdown()Stop executing all consumer workvoidstopWork(Channel channel)Stop executing all consumer work for a particular channelbooleanusesPrivateExecutor()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
MAX_RUNNABLE_BLOCK_SIZE
private static final int MAX_RUNNABLE_BLOCK_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_NUM_THREADS
private static final int DEFAULT_NUM_THREADS
-
executor
private final java.util.concurrent.ExecutorService executor
-
privateExecutor
private final boolean privateExecutor
-
shutdownTimeout
private final int shutdownTimeout
-
-
Constructor Detail
-
ConsumerWorkService
public ConsumerWorkService(java.util.concurrent.ExecutorService executor, java.util.concurrent.ThreadFactory threadFactory, int queueingTimeout, int shutdownTimeout)
-
ConsumerWorkService
public ConsumerWorkService(java.util.concurrent.ExecutorService executor, java.util.concurrent.ThreadFactory threadFactory, int shutdownTimeout)
-
-
Method Detail
-
getShutdownTimeout
public int getShutdownTimeout()
-
shutdown
public void shutdown()
Stop executing all consumer work
-
stopWork
public void stopWork(Channel channel)
Stop executing all consumer work for a particular channel- Parameters:
channel- to stop consumer work for
-
registerKey
public void registerKey(Channel channel)
-
setUnlimited
public void setUnlimited(Channel channel, boolean unlimited)
-
addWork
public void addWork(Channel channel, java.lang.Runnable runnable)
-
usesPrivateExecutor
public boolean usesPrivateExecutor()
- Returns:
- true if executor used by this work service is managed by it and wasn't provided by the user
-
-