Write tests for docker integration, as docker is how we will initially handle distribution on heterogeneous hardware.
145 lines
8.4 KiB
XML
145 lines
8.4 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 700" font-family="system-ui, sans-serif">
|
|
<defs>
|
|
<!-- Drop shadow filter -->
|
|
<filter id="shadow" x="-4%" y="-4%" width="108%" height="108%">
|
|
<feDropShadow dx="1" dy="2" stdDeviation="3" flood-color="#000" flood-opacity="0.10"/>
|
|
</filter>
|
|
<!-- Arrow markers -->
|
|
<marker id="arrow-gray" viewBox="0 0 10 7" refX="10" refY="3.5"
|
|
markerWidth="10" markerHeight="7" orient="auto-start-reverse" fill="#5f6368">
|
|
<polygon points="0 0, 10 3.5, 0 7"/>
|
|
</marker>
|
|
<marker id="arrow-green" viewBox="0 0 10 7" refX="10" refY="3.5"
|
|
markerWidth="10" markerHeight="7" orient="auto-start-reverse" fill="#34a853">
|
|
<polygon points="0 0, 10 3.5, 0 7"/>
|
|
</marker>
|
|
<marker id="arrow-red" viewBox="0 0 10 7" refX="10" refY="3.5"
|
|
markerWidth="10" markerHeight="7" orient="auto-start-reverse" fill="#ea4335">
|
|
<polygon points="0 0, 10 3.5, 0 7"/>
|
|
</marker>
|
|
</defs>
|
|
|
|
<!-- Background -->
|
|
<rect width="1000" height="700" rx="8" fill="#f8f9fb" stroke="#e0e3e8" stroke-width="1.5"/>
|
|
|
|
<!-- Title -->
|
|
<text x="500" y="42" text-anchor="middle" font-size="20" font-weight="bold" fill="#202124">Actor Lifecycle</text>
|
|
<text x="500" y="62" text-anchor="middle" font-size="12" fill="#5f6368">src/runtime.rs · src/worker.rs</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- Entry circle -->
|
|
<circle cx="90" cy="200" r="16" fill="#4285f4" filter="url(#shadow)"/>
|
|
<text x="90" y="205" text-anchor="middle" font-size="14" fill="#fff" font-weight="bold">▶</text>
|
|
|
|
<!-- Arrow: entry → SPAWNED -->
|
|
<line x1="106" y1="200" x2="156" y2="200" stroke="#5f6368" stroke-width="1.8" marker-end="url(#arrow-gray)"/>
|
|
<text x="131" y="192" text-anchor="middle" font-size="11" fill="#5f6368">spawn()</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: SPAWNED -->
|
|
<rect x="168" y="170" width="155" height="60" rx="12" fill="#e8f0fe" stroke="#4285f4" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="245" y="196" text-anchor="middle" font-size="14" font-weight="600" fill="#1a73e8">SPAWNED</text>
|
|
<text x="245" y="214" text-anchor="middle" font-size="10" fill="#5f6368">in spawn queue</text>
|
|
|
|
<!-- Arrow: SPAWNED → READY -->
|
|
<line x1="323" y1="200" x2="393" y2="200" stroke="#5f6368" stroke-width="1.8" marker-end="url(#arrow-gray)"/>
|
|
<text x="358" y="190" text-anchor="middle" font-size="11" fill="#5f6368">Phase 1/4</text>
|
|
<text x="358" y="203" text-anchor="middle" font-size="10" fill="#5f6368">drain →</text>
|
|
<text x="358" y="215" text-anchor="middle" font-size="10" fill="#5f6368">pool.insert()</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: READY -->
|
|
<rect x="405" y="170" width="155" height="60" rx="12" fill="#e6f4ea" stroke="#34a853" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="482" y="196" text-anchor="middle" font-size="14" font-weight="600" fill="#137333">READY</text>
|
|
<text x="482" y="214" text-anchor="middle" font-size="10" fill="#5f6368">in pool, mailbox empty</text>
|
|
|
|
<!-- Arrow: READY → MAILBOX_PENDING (down) -->
|
|
<line x1="482" y1="230" x2="482" y2="320" stroke="#5f6368" stroke-width="1.8" marker-end="url(#arrow-gray)"/>
|
|
<text x="492" y="266" font-size="11" fill="#5f6368">send_to /</text>
|
|
<text x="492" y="280" font-size="10" fill="#5f6368">deliver pushes</text>
|
|
<text x="492" y="293" font-size="10" fill="#5f6368">to VecDeque</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: MAILBOX_PENDING -->
|
|
<rect x="405" y="330" width="155" height="60" rx="12" fill="#fef7e0" stroke="#f9ab00" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="482" y="354" text-anchor="middle" font-size="13" font-weight="600" fill="#e37400">MAILBOX</text>
|
|
<text x="482" y="372" text-anchor="middle" font-size="13" font-weight="600" fill="#e37400">PENDING</text>
|
|
|
|
<!-- Arrow: MAILBOX_PENDING → PROCESSING (right) -->
|
|
<line x1="560" y1="360" x2="630" y2="360" stroke="#5f6368" stroke-width="1.8" marker-end="url(#arrow-gray)"/>
|
|
<text x="595" y="350" text-anchor="middle" font-size="11" fill="#5f6368">Phase 3</text>
|
|
<text x="595" y="374" text-anchor="middle" font-size="10" fill="#5f6368">pop_front()</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: PROCESSING -->
|
|
<rect x="642" y="330" width="155" height="60" rx="12" fill="#e8f0fe" stroke="#4285f4" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="719" y="356" text-anchor="middle" font-size="14" font-weight="600" fill="#1a73e8">PROCESSING</text>
|
|
<text x="719" y="374" text-anchor="middle" font-size="10" fill="#5f6368">handler executing</text>
|
|
|
|
<!-- Arrow: PROCESSING → READY (success, up and left, curved) -->
|
|
<path d="M 719 330 Q 719 268 600 200 Q 580 190 560 200"
|
|
fill="none" stroke="#34a853" stroke-width="1.8" marker-end="url(#arrow-green)"/>
|
|
<text x="670" y="258" font-size="11" fill="#34a853" font-weight="600">handler OK</text>
|
|
|
|
<!-- Arrow: PROCESSING → PANIC_STATE (down) -->
|
|
<line x1="719" y1="390" x2="719" y2="470" stroke="#ea4335" stroke-width="1.8" marker-end="url(#arrow-red)"/>
|
|
<text x="740" y="430" font-size="11" fill="#ea4335" font-weight="600">panic!</text>
|
|
<text x="740" y="444" font-size="10" fill="#ea4335">catch_unwind</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: PANIC_STATE -->
|
|
<rect x="642" y="480" width="155" height="60" rx="12" fill="#fce8e6" stroke="#ea4335" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="719" y="506" text-anchor="middle" font-size="14" font-weight="600" fill="#c5221f">PANIC</text>
|
|
<text x="719" y="524" text-anchor="middle" font-size="10" fill="#5f6368">caught, actor survives</text>
|
|
|
|
<!-- Arrow: PANIC_STATE → PROCESSING (loop back left then up) -->
|
|
<path d="M 642 510 Q 610 510 610 440 Q 610 370 630 360"
|
|
fill="none" stroke="#5f6368" stroke-width="1.8" stroke-dasharray="5,3" marker-end="url(#arrow-gray)"/>
|
|
<text x="580" y="450" font-size="10" fill="#5f6368">next msg,</text>
|
|
<text x="580" y="463" font-size="10" fill="#5f6368">next tick</text>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- STATE: DEAD -->
|
|
<rect x="168" y="480" width="155" height="60" rx="12" fill="#f1f3f4" stroke="#9aa0a6" stroke-width="1.8" filter="url(#shadow)"/>
|
|
<text x="245" y="506" text-anchor="middle" font-size="14" font-weight="600" fill="#5f6368">DEAD</text>
|
|
<text x="245" y="524" text-anchor="middle" font-size="10" fill="#5f6368">removed from pool</text>
|
|
|
|
<!-- Arrow: READY → DEAD -->
|
|
<path d="M 405 220 Q 350 250 310 350 Q 280 420 280 470"
|
|
fill="none" stroke="#9aa0a6" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrow-gray)"/>
|
|
<text x="310" y="380" font-size="10" fill="#9aa0a6">shutdown /</text>
|
|
<text x="310" y="393" font-size="10" fill="#9aa0a6">pool.remove()</text>
|
|
|
|
<!-- Arrow: PROCESSING → DEAD -->
|
|
<path d="M 642 385 Q 500 440 370 480"
|
|
fill="none" stroke="#9aa0a6" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrow-gray)"/>
|
|
<text x="490" y="446" font-size="10" fill="#9aa0a6">shutdown</text>
|
|
|
|
<!-- Arrow: PANIC_STATE → DEAD -->
|
|
<path d="M 642 510 Q 500 520 340 510"
|
|
fill="none" stroke="#9aa0a6" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrow-gray)"/>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- Legend -->
|
|
<rect x="50" y="600" width="900" height="75" rx="8" fill="none" stroke="#e0e3e8" stroke-width="1"/>
|
|
<text x="70" y="622" font-size="12" font-weight="600" fill="#202124">Legend</text>
|
|
|
|
<!-- Normal arrow -->
|
|
<line x1="70" y1="645" x2="105" y2="645" stroke="#5f6368" stroke-width="1.8" marker-end="url(#arrow-gray)"/>
|
|
<text x="115" y="649" font-size="11" fill="#5f6368">Transition</text>
|
|
|
|
<!-- Success arrow -->
|
|
<line x1="220" y1="645" x2="255" y2="645" stroke="#34a853" stroke-width="1.8" marker-end="url(#arrow-green)"/>
|
|
<text x="265" y="649" font-size="11" fill="#34a853">Success</text>
|
|
|
|
<!-- Error arrow -->
|
|
<line x1="370" y1="645" x2="405" y2="645" stroke="#ea4335" stroke-width="1.8" marker-end="url(#arrow-red)"/>
|
|
<text x="415" y="649" font-size="11" fill="#ea4335">Error / Panic</text>
|
|
|
|
<!-- Dashed arrow -->
|
|
<line x1="540" y1="645" x2="575" y2="645" stroke="#9aa0a6" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrow-gray)"/>
|
|
<text x="585" y="649" font-size="11" fill="#9aa0a6">Shutdown path</text>
|
|
|
|
<!-- Source refs -->
|
|
<text x="780" y="649" font-size="10" fill="#9aa0a6">runtime.rs:125-134 · worker.rs:204-219</text>
|
|
</svg>
|