Exporting a report in the background
The same notation turned on its side: participants one below the other, time running right, for a wide, low place on the page. With the default orientation, auto, a diagram takes this form by itself wherever only it fits the canvas.
Exporting a report in the background
examples/async-export.json{
"schemaVersion": 1,
"type": "sequence",
"title": "Exporting a report in the background",
"source": "Service handbook, export flow",
"width": 1300,
"height": 400,
"sequence": {
"orientation": "landscape",
"participants": [
{
"id": "client",
"label": "Browser",
"kind": "actor"
},
{
"id": "api",
"label": "Export API"
},
{
"id": "queue",
"label": "Jobs",
"kind": "queue"
},
{
"id": "worker",
"label": "Worker"
},
{
"id": "files",
"label": "File storage",
"kind": "external"
}
],
"messages": [
{
"from": "client",
"to": "api",
"label": "POST /exports"
},
{
"from": "api",
"to": "queue",
"label": "enqueue",
"kind": "async"
},
{
"from": "api",
"to": "client",
"label": "202, job id",
"kind": "reply"
},
{
"from": "worker",
"to": "queue",
"label": "take job"
},
{
"from": "worker",
"to": "files",
"label": "write report"
},
{
"from": "client",
"to": "api",
"label": "GET /exports/7"
},
{
"from": "api",
"to": "client",
"label": "running",
"kind": "reply"
},
{
"from": "worker",
"to": "api",
"label": "done",
"kind": "async"
},
{
"from": "client",
"to": "api",
"label": "GET /exports/7"
},
{
"from": "api",
"to": "client",
"label": "download link",
"kind": "reply"
}
],
"fragments": [
{
"kind": "loop",
"label": "every 5 s",
"from": 5,
"to": 6
}
]
}
}Focus
Source: Service handbook, export flow
Show chart data
| No. | From | To | Message | Kind | Fragment |
|---|---|---|---|---|---|
| 1 | Browser | Export API | POST /exports | call | |
| 2 | Export API | Jobs | enqueue | asynchronous | |
| 3 | Export API | Browser | 202, job id | reply | |
| 4 | Worker | Jobs | take job | call | |
| 5 | Worker | File storage | write report | call | |
| 6 | Browser | Export API | GET /exports/7 | call | loop [every 5 s] |
| 7 | Export API | Browser | running | reply | loop [every 5 s] |
| 8 | Worker | Export API | done | asynchronous | |
| 9 | Browser | Export API | GET /exports/7 | call | |
| 10 | Export API | Browser | download link | reply |