chartletv0.21.0chartlet.casoon.de

← All examples

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
Exporting a report in the background
Exporting a report in the backgroundSequence diagram with 5 participants: Browser (actor), Export API, Jobs (queue), Worker and File storage (external). 10 messages, in order: 1. Browser to Export API: POST /exports. 2. Export API to Jobs: enqueue (asynchronous). 3. Export API to Browser: 202, job id (reply). 4. Worker to Jobs: take job. 5. Worker to File storage: write report. 6. Browser to Export API: GET /exports/7. 7. Export API to Browser: running (reply). 8. Worker to Export API: done (asynchronous). 9. Browser to Export API: GET /exports/7. 10. Export API to Browser: download link (reply). Fragment loop "every 5 s" spans messages 6–7.loop[every 5 s]1. Browser → Export API: POST /exportsPOST /exports2. Export API → Jobs: enqueueenqueue3. Export API → Browser: 202, job id202, job id4. Worker → Jobs: take jobtake job5. Worker → File storage: write reportwrite report6. Browser → Export API: GET /exports/7GET /exports/77. Export API → Browser: runningrunning8. Worker → Export API: donedone9. Browser → Export API: GET /exports/7GET /exports/710. Export API → Browser: download linkdownload linkBrowserBrowserExport APIExport APIJobsJobsWorkerWorkerFile storageFile storage

Source: Service handbook, export flow

Show chart data
Data for Exporting a report in the background
No.FromToMessageKindFragment
1BrowserExport APIPOST /exportscall
2Export APIJobsenqueueasynchronous
3Export APIBrowser202, job idreply
4WorkerJobstake jobcall
5WorkerFile storagewrite reportcall
6BrowserExport APIGET /exports/7callloop [every 5 s]
7Export APIBrowserrunningreplyloop [every 5 s]
8WorkerExport APIdoneasynchronous
9BrowserExport APIGET /exports/7call
10Export APIBrowserdownload linkreply
  • Sequence diagram (landscape)
  • Fit a flow into a wide format