Configure what you want to happen when there is more than one run at a time.
concurrencyLimit
property on the task’s queue. This limits the number of runs that can be executing at any one time:
task1
and task2
share the same queue, so only one of them can run at a time.
concurrencyKey
. It creates a separate queue for each value of the key.
Your backend code:
WAITING
state and releases its concurrency slot back to both the queue and the environment, allowing other runs to execute or resume.
This means that:
WAITING
state (checkpointed at waitpoints) do not consume concurrency slotsWAITING
state than your queue’s concurrency limitconcurrencyLimit
of 1:
WAITING
state that belong to that queuetriggerAndWait
call, it checkpoints and transitions to the WAITING
state, releasing its concurrency slot back to both its queue and the environment. Once the subtask completes, the parent task will resume and re-acquire a concurrency slot.
triggerAndWait
call, it releases its concurrency slot back to the queue, allowing the subtask to execute. Once the subtask completes, the parent task will resume.
However, you can only have recursive waits up to your queue’s concurrency limit. If you exceed this limit, you will receive a RECURSIVE_WAIT_DEADLOCK
error:
RECURSIVE_WAIT_DEADLOCK
error because the queue can only support one level of recursive waiting with a concurrency limit of 1: