Task Ordering
Long Runner supports two task scheduling modes.
Unordered task types use the normal capacity-based behavior. Pending tasks are eligible as soon as an executor type can run them.
Ordered task types use orderKey lanes. Tasks with the same task type and orderKey run one at a time in task id order. Tasks with different orderKey values can still run in parallel.
Task Type
TaskType.ordered controls whether a task type uses ordering:
{
"hid": "tika-to-lm",
"ordered": true
}
Existing task types default to unordered.
Task Creation
Unordered task types must not include orderKey:
{
"taskTypeHid": "image-thumbnail",
"isExternal": false,
"ownerContext": {
"tenantId": 0,
"userId": 0
},
"input": null
}
Ordered task types must include a non-blank orderKey:
{
"taskTypeHid": "tika-to-lm",
"orderKey": "effective-sha256-value",
"isExternal": false,
"ownerContext": {
"tenantId": 0,
"userId": 0
},
"input": null
}
The scheduler scopes ordering to (taskType, orderKey). The same orderKey value in another task type is a different lane.
API
Use /api/task-type-hids when only task type HIDs are needed:
[
"image-thumbnail",
"tika-to-lm"
]
Use /api/task-types when ordering metadata is needed:
[
{
"hid": "image-thumbnail",
"ordered": false
},
{
"hid": "tika-to-lm",
"ordered": true
}
]