Concepts
Task lifecycle
The statuses an Astrum Solver task moves through and how to poll for them correctly.
A task exists in one of three states. You create it, a worker picks it up, and it closes with either a solution or an error.
| Status | Meaning | What to do |
|---|---|---|
| opened | Queued, no worker has taken it yet. | Keep polling. |
| in_progress | A worker is solving it. | Keep polling. |
| closed | Finished. The solution or the error is attached. | Read the solution and stop. |
Polling
- Leave about three seconds between calls. Faster polling does not make a task close sooner.
- Give up after a sensible ceiling of your own and create a new task rather than polling forever.
- A result is removed once you collect it, so store the solution on your side.
Results that are never collected are cleaned up about an hour after they close. Collect them well inside that window.
Response shape
getTaskResult, closed successfully
{
"errorId": 0,
"status": "closed",
"solution": { "token": "…" },
"errorCode": null,
"errorDescription": null
}