IRPCApplicationTaskQueue.ReserveTasksForProcessing
Server integration API / specialized write session
Reserves the next waiting task from each of the given queues for the caller to process.
| Service | Application task queue MFiles.IRPCApplicationTaskQueue |
|---|---|
| gRPC method | /MFiles.IRPCApplicationTaskQueue/ReserveTasksForProcessing |
| HTTP (mf-http-grpc) | POST /grpc/v1/reserve-tasks-for-processing |
| Request | ReserveTasksForProcessingRequest |
| Response | ReserveTasksForProcessingResponse |
| Book and level | Server integration API, specialized |
| Kind | write |
| Session | Required: the session ID from LogIn in the mfiles-session-id-bin metadata. |
| Idempotent | no |
| Returns metadata structure version | no |
| Streaming | none (unary) |
Remarks
- Returns at most one task per queue, already in state
APPLICATION_TASK_STATE_IN_PROGRESS; queues with nothing to do contribute nothing. Call it again to get more tasks. - From a sequential queue, no task is returned while another task of that queue is in progress.
- Tasks added with AddScheduledTask are not returned before their activation time.
- Every queue must be open ("The task queue is not open." otherwise), and the same queue ID must
not appear twice. Requires a vault session and the vault right
change_full_control_role.
Request: ReserveTasksForProcessingRequest
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
queue_id_collection[] | repeated string | The IDs of the queues to take tasks from. |
Response: ReserveTasksForProcessingResponse
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
task_info_collection[] | repeated ApplicationTaskInfo | The reserved tasks, at most one per queue. |
task_info_collection[].queue_id | string | ID of the task queue this task belongs to. |
task_info_collection[].task_id | string | ID of this task. |
task_info_collection[].state | ApplicationTaskState | Current state of this task.Values: APPLICATION_TASK_STATE_WAITING (0), APPLICATION_TASK_STATE_IN_PROGRESS (1), APPLICATION_TASK_STATE_COMPLETED (2), APPLICATION_TASK_STATE_FAILED (3), APPLICATION_TASK_STATE_CANCELED (4), APPLICATION_TASK_STATE_NONE (5). |
task_info_collection[].progress | string | Current task specific progress amount. |
task_info_collection[].task_type | string | Defines the task type. |
task_info_collection[].task_data | bytes | Any type specific task payload data. |
task_info_collection[].activation_timestamp | google.protobuf.Timestamp | The earliest time this task can be reserved for processing. |
task_info_collection[].latest_activity_timestamp | google.protobuf.Timestamp | The last modified timestamp. |
Related methods
- AddScheduledTask -- Adds a task to a task queue that becomes available for processing at a given time.