Skip to main content

Get Task Queue Size for a Task Type

Endpoint: GET /api/tasks/queue/sizes

Gets the task queue size for a specified task type. The queue size represents the number of tasks of the given type waiting to be processed.

Query parameters

ParameterDescriptionTypeRequired/ Optional
taskTypeThe type of the task to be queried. For predefined tasks, this indicates the task type, such as HTTP. For user-defined tasks, it corresponds to the task definition name, such as python_worker.stringRequired.

Response

Returns a JSON object containing the task type as the key and its queue size as the value.

Examples

Get task queue for HTTP tasks

Request

curl -X 'GET' \
'https://<YOUR-SERVER-URL>/api/tasks/queue/sizes?taskType=HTTP' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>'

Response

{
"HTTP": 3
}
Get task queue for a custom Worker task

Request

curl -X 'GET' \
'https://<YOUR-SERVER-URL>/api/tasks/queue/sizes?taskType=simple-java-worker' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>'

Response

{
"simple-java-worker": 1
}