[#BloombergLP-bdlmt-MultipriorityThreadPool-enqueueJob-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/MultipriorityThreadPool.adoc[MultipriorityThreadPool]::enqueueJob
:relfileprefix: ../../../
:mrdocs:

Enqueue the specified job at the specified priority&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
enqueueJob(
    xref:BloombergLP/bdlmt/MultipriorityThreadPool/ThreadFunctor.adoc[ThreadFunctor] const& job,
    int priority);
----

== Description

Add the specified `job` to the queue of this multi&hyphen;priority thread pool, assigning it the specified `priority`&period; Return 0 if the job was enqueued successfully, and a non&hyphen;zero value otherwise (implying that the queue was in the disabled state)&period; The behavior is undefined unless `0 &lt;&equals; priority &lt; numPriorities()`&period;

== Return Value

0 if the job was enqueued, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *job*
| functor to be executed by a worker thread
| *priority*
| job priority&semi; 0 is most urgent
|===


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