[#BloombergLP-bdlmt-MultiQueueThreadPool]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::MultiQueueThreadPool
:relfileprefix: ../../
:mrdocs:

This class implements a dynamic, configurable pool of queues, each of which is processed serially by a thread pool&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;multiqueuethreadpool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class MultiQueueThreadPool;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/CleanupFunctor.adoc[`CleanupFunctor`] 
| Defines a type alias for the queue cleanup functor type&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/Job.adoc[`Job`] 
| Defines a type alias for the job functor type&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/QueueRegistry.adoc[`QueueRegistry`] 
| Defines a type alias for the registry mapping queue IDs to queues&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/2constructor-01.adoc[`MultiQueueThreadPool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/2destructor.adoc[`&#126;MultiQueueThreadPool`] [.small]#[destructor]#
| Destroy this multi&hyphen;queue thread pool&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/addJobAtFront-0b.adoc[`addJobAtFront`] 
| `addJobAtFront` overloads
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/batchSize.adoc[`batchSize`] 
| Return the batch size of queue `id`, or &hyphen;1 if invalid&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/createQueue.adoc[`createQueue`] 
| Create a new queue and return its non&hyphen;zero identifier&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/deleteQueue-04.adoc[`deleteQueue`] 
| `deleteQueue` overloads
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/disableQueue.adoc[`disableQueue`] 
| Disable enqueuing to the queue associated with the specified `id`&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/drain.adoc[`drain`] 
| Wait until all non&hyphen;paused queues are empty&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/drainQueue.adoc[`drainQueue`] 
| Wait until all jobs in the queue with the specified `id` finish&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/enableQueue.adoc[`enableQueue`] 
| Enable enqueuing to the queue associated with the specified `id`&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/enqueueJob-0b.adoc[`enqueueJob`] 
| `enqueueJob` overloads
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/isEnabled.adoc[`isEnabled`] 
| Return `true` if the queue associated with the specified `id` is currently enabled, or `false` otherwise (including if `id` is not a valid queue id)&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/isPaused.adoc[`isPaused`] 
| Return `true` if the queue associated with the specified `id` is currently paused, or `false` otherwise (including if `id` is not a valid queue id)&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/numElements-0f.adoc[`numElements`] 
| `numElements` overloads
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/numProcessed.adoc[`numProcessed`] 
| Load processed item counts into the output parameters&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/numProcessedReset.adoc[`numProcessedReset`] 
| Reset and return processed&sol;enqueued&sol;deleted counts&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/numQueues.adoc[`numQueues`] 
| Return an instantaneous snapshot of the number of queues managed by this object&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/pauseQueue.adoc[`pauseQueue`] 
| Pause the queue with the specified `id` after the current job finishes&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/resumeQueue.adoc[`resumeQueue`] 
| Allow jobs on the queue with the specified `id` to begin executing&period; Return 0 on success, and a non&hyphen;zero value if the queue does not exist or is not paused&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/setBatchSize.adoc[`setBatchSize`] 
| Set the job execution batch size for the queue with the specified `id`&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/shutdown.adoc[`shutdown`] 
| Disable queuing, delete all queues, and shut down the owned pool&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/start.adoc[`start`] 
| Start queuing and the owned thread pool&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/stop.adoc[`stop`] 
| Disable queuing and stop the owned thread pool once queues drain&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/threadPool.adoc[`threadPool`] 
| Return a reference to the non&hyphen;modifiable thread pool owned by this object&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;MultiQueueThreadPool, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlmt/MultiQueueThreadPool_Queue.adoc[BloombergLP::bdlmt::MultiQueueThreadPool&lowbar;Queue]`
| This private class provides a thread&hyphen;safe, lightweight job queue&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
