ClaimItems API - Optionally return the "run as" (contact ID/domain ID) #24761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The
ClaimItems
API provides a facade for remote workers callingCRM_Queue_Queue_*::claimItems()
. Some items have "run as" flags (egCRM_Queue_Task::$runAs
). This patch makes it easier to read "runAs".Before
Not specifically returned.
After
Available as an optional value "select" field.
Comments
This makes it easier/cheaper for
coworker
to run tasks from various users/domains. It complements this draft update: https://lab.civicrm.org/dev/coworker/-/commit/d92fe0892b2602a99df78ed7f74b381925d481ebThis currently only returns the "run as" for
CRM_Queue_Task
. Using identities with other types of queue-items is currently hypothetical. Dealing with that hypothetical is a longer write-up/topic, but IMHO this is reasonably aligned with how that edge-case should get resolved.