Files
progcode/web/public/assets/editorial/2020/background-job-lifecycle-2020.svg
T
huncode 406e60bf44
Build and deploy / deploy (push) Successful in 13s
revise May 2020 background job articles
2026-07-31 11:27:15 +03:00

59 lines
4.4 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 1320" role="img" aria-labelledby="title desc">
<title id="title">Жизненный цикл фоновой задачи</title>
<desc id="desc">Вертикальная схема показывает запись задачи и outbox, публикацию, обработку worker-ом, сохранение результата перед ack, повтор при временной ошибке и карантин постоянной ошибки.</desc>
<defs>
<marker id="arrow" viewBox="0 0 12 12" refX="6" refY="6" markerWidth="10" markerHeight="10" orient="auto-start-reverse"><path d="M 1 1 L 11 6 L 1 11 z" fill="#516274" /></marker>
<style>
.title { fill: #182230; font: 700 34px system-ui, -apple-system, sans-serif; }
.lead { fill: #516274; font: 400 22px system-ui, -apple-system, sans-serif; }
.step { fill: #182230; font: 700 27px system-ui, -apple-system, sans-serif; }
.copy { fill: #354458; font: 400 23px system-ui, -apple-system, sans-serif; }
.tag { fill: #ffffff; font: 700 22px system-ui, -apple-system, sans-serif; }
.small { fill: #516274; font: 400 21px system-ui, -apple-system, sans-serif; }
</style>
</defs>
<rect width="720" height="1320" fill="#f6f8fb" rx="28" />
<text class="title" x="52" y="72">Жизненный цикл одной задачи</text>
<text class="lead" x="52" y="108">jobId связывает запись, delivery и результат</text>
<rect x="48" y="148" width="624" height="142" rx="22" fill="#e7f0ff" stroke="#4a78bd" stroke-width="3" />
<rect x="72" y="176" width="88" height="42" rx="21" fill="#3167b1" />
<text class="tag" x="94" y="205">HTTP</text>
<text class="step" x="184" y="203">Записать job и outbox</text>
<text class="copy" x="184" y="244">Ответ: принято, jobId известен</text>
<line x1="360" y1="292" x2="360" y2="340" stroke="#516274" stroke-width="5" marker-end="url(#arrow)" />
<rect x="48" y="356" width="624" height="142" rx="22" fill="#eef3f7" stroke="#738195" stroke-width="3" />
<rect x="72" y="384" width="132" height="42" rx="21" fill="#516274" />
<text class="tag" x="91" y="413">DISPATCH</text>
<text class="step" x="226" y="411">Опубликовать jobId</text>
<text class="copy" x="226" y="452">Только затем отметить outbox</text>
<line x1="360" y1="500" x2="360" y2="548" stroke="#516274" stroke-width="5" marker-end="url(#arrow)" />
<rect x="48" y="564" width="624" height="142" rx="22" fill="#fff4d7" stroke="#c68819" stroke-width="3" />
<rect x="72" y="592" width="112" height="42" rx="21" fill="#b47700" />
<text class="tag" x="92" y="621">WORKER</text>
<text class="step" x="210" y="619">Прочитать job по jobId</text>
<text class="copy" x="210" y="660">Delivery ещё не подтверждён</text>
<line x1="360" y1="708" x2="360" y2="756" stroke="#516274" stroke-width="5" marker-end="url(#arrow)" />
<rect x="48" y="772" width="624" height="156" rx="22" fill="#e4f6ea" stroke="#25855a" stroke-width="3" />
<rect x="72" y="800" width="102" height="42" rx="21" fill="#16764c" />
<text class="tag" x="97" y="829">УСПЕХ</text>
<text class="step" x="200" y="827">Сохранить result + succeeded</text>
<text class="copy" x="200" y="868">Только после этого отправить ACK</text>
<text class="small" x="200" y="902">Повтор увидит terminal state</text>
<line x1="360" y1="930" x2="360" y2="978" stroke="#516274" stroke-width="5" marker-end="url(#arrow)" />
<rect x="48" y="994" width="624" height="126" rx="22" fill="#fff1df" stroke="#c97918" stroke-width="3" />
<rect x="72" y="1023" width="102" height="42" rx="21" fill="#b76500" />
<text class="tag" x="95" y="1052">RETRY</text>
<text class="step" x="201" y="1050">Временная ошибка: retry_wait</text>
<text class="copy" x="201" y="1090">Ограниченный повтор вернётся к worker</text>
<line x1="360" y1="1122" x2="360" y2="1170" stroke="#516274" stroke-width="5" marker-end="url(#arrow)" />
<rect x="48" y="1186" width="624" height="98" rx="22" fill="#fde9ea" stroke="#b4434b" stroke-width="3" />
<text class="step" x="76" y="1228">Постоянная ошибка или лимит</text>
<text class="copy" x="76" y="1265">→ quarantine / DLX</text>
</svg>