1
0
mirror of https://github.com/actix/actix-website synced 2024-12-12 16:00:23 +01:00
actix-website/static/img/diagrams/connection_accept.svg
Maxim Vorobjov c1a8103cbc Architecture diagrams of HttpServer and Connection lifecycle (#148)
* add arch diagrams and menu

* fix colors for arch diagrams

* refine architecture diagrams, ready for review

* capitalize titles and add mmdc instruction

* apply code review requested changes

* Add links to accept, worker and dispatcher too
2020-01-28 20:36:35 +09:00

4 lines
15 KiB
XML

<svg id="mermaid-1579867443335" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:850px;" viewBox="-50 -10 850 807"><style>#mermaid-1579867443335 .label{font-family:trebuchet ms,verdana,arial;color:#333}#mermaid-1579867443335 .node circle,#mermaid-1579867443335 .node ellipse,#mermaid-1579867443335 .node polygon,#mermaid-1579867443335 .node rect{fill:#eee;stroke:#999;stroke-width:1px}#mermaid-1579867443335 .node.clickable{cursor:pointer}#mermaid-1579867443335 .arrowheadPath{fill:#333}#mermaid-1579867443335 .edgePath .path{stroke:#666;stroke-width:1.5px}#mermaid-1579867443335 .edgeLabel{background-color:#fff}#mermaid-1579867443335 .cluster rect{fill:#eaf2fb!important;stroke:#26a!important;stroke-width:1px!important}#mermaid-1579867443335 .cluster text{fill:#333}#mermaid-1579867443335 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:trebuchet ms,verdana,arial;font-size:12px;background:#eaf2fb;border:1px solid #26a;border-radius:2px;pointer-events:none;z-index:100}#mermaid-1579867443335 .actor{stroke:#999;fill:#eee}#mermaid-1579867443335 text.actor{fill:#333;stroke:none}#mermaid-1579867443335 .actor-line{stroke:#666}#mermaid-1579867443335 .messageLine0{marker-end:"url(#arrowhead)"}#mermaid-1579867443335 .messageLine0,#mermaid-1579867443335 .messageLine1{stroke-width:1.5;stroke-dasharray:"2 2";stroke:#333}#mermaid-1579867443335 #arrowhead{fill:#333}#mermaid-1579867443335 #crosshead path{fill:#333!important;stroke:#333!important}#mermaid-1579867443335 .messageText{fill:#333;stroke:none}#mermaid-1579867443335 .labelBox{stroke:#999;fill:#eee}#mermaid-1579867443335 .labelText,#mermaid-1579867443335 .loopText{fill:#fff;stroke:none}#mermaid-1579867443335 .loopLine{stroke-width:2;stroke-dasharray:"2 2";marker-end:"url(#arrowhead)";stroke:#999}#mermaid-1579867443335 .note{stroke:#770;fill:#ffa}#mermaid-1579867443335 .noteText{fill:#000;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:14px}#mermaid-1579867443335 .section{stroke:none;opacity:.2}#mermaid-1579867443335 .section0,#mermaid-1579867443335 .section2{fill:#80b3e6}#mermaid-1579867443335 .section1,#mermaid-1579867443335 .section3{fill:#fff;opacity:.2}#mermaid-1579867443335 .sectionTitle0,#mermaid-1579867443335 .sectionTitle1,#mermaid-1579867443335 .sectionTitle2,#mermaid-1579867443335 .sectionTitle3{fill:#333}#mermaid-1579867443335 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px}#mermaid-1579867443335 .grid .tick{stroke:#e6e6e6;opacity:.3;shape-rendering:crispEdges}#mermaid-1579867443335 .grid path{stroke-width:0}#mermaid-1579867443335 .today{fill:none;stroke:#d42;stroke-width:2px}#mermaid-1579867443335 .task{stroke-width:2}#mermaid-1579867443335 .taskText{text-anchor:middle;font-size:11px}#mermaid-1579867443335 .taskTextOutsideRight{fill:#333;text-anchor:start;font-size:11px}#mermaid-1579867443335 .taskTextOutsideLeft{fill:#333;text-anchor:end;font-size:11px}#mermaid-1579867443335 .taskText0,#mermaid-1579867443335 .taskText1,#mermaid-1579867443335 .taskText2,#mermaid-1579867443335 .taskText3{fill:#fff}#mermaid-1579867443335 .task0,#mermaid-1579867443335 .task1,#mermaid-1579867443335 .task2,#mermaid-1579867443335 .task3{fill:#26a;stroke:#1a4d80}#mermaid-1579867443335 .taskTextOutside0,#mermaid-1579867443335 .taskTextOutside1,#mermaid-1579867443335 .taskTextOutside2,#mermaid-1579867443335 .taskTextOutside3{fill:#333}#mermaid-1579867443335 .active0,#mermaid-1579867443335 .active1,#mermaid-1579867443335 .active2,#mermaid-1579867443335 .active3{fill:#eee;stroke:#1a4d80}#mermaid-1579867443335 .activeText0,#mermaid-1579867443335 .activeText1,#mermaid-1579867443335 .activeText2,#mermaid-1579867443335 .activeText3{fill:#333!important}#mermaid-1579867443335 .done0,#mermaid-1579867443335 .done1,#mermaid-1579867443335 .done2,#mermaid-1579867443335 .done3{stroke:#666;fill:#bbb;stroke-width:2}#mermaid-1579867443335 .doneText0,#mermaid-1579867443335 .doneText1,#mermaid-1579867443335 .doneText2,#mermaid-1579867443335 .doneText3{fill:#333!important}#mermaid-1579867443335 .crit0,#mermaid-1579867443335 .crit1,#mermaid-1579867443335 .crit2,#mermaid-1579867443335 .crit3{stroke:#b1361b;fill:#d42;stroke-width:2}#mermaid-1579867443335 .activeCrit0,#mermaid-1579867443335 .activeCrit1,#mermaid-1579867443335 .activeCrit2,#mermaid-1579867443335 .activeCrit3{stroke:#b1361b;fill:#eee;stroke-width:2}#mermaid-1579867443335 .doneCrit0,#mermaid-1579867443335 .doneCrit1,#mermaid-1579867443335 .doneCrit2,#mermaid-1579867443335 .doneCrit3{stroke:#b1361b;fill:#bbb;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1579867443335 .activeCritText0,#mermaid-1579867443335 .activeCritText1,#mermaid-1579867443335 .activeCritText2,#mermaid-1579867443335 .activeCritText3,#mermaid-1579867443335 .doneCritText0,#mermaid-1579867443335 .doneCritText1,#mermaid-1579867443335 .doneCritText2,#mermaid-1579867443335 .doneCritText3{fill:#333!important}#mermaid-1579867443335 .titleText{text-anchor:middle;font-size:18px;fill:#333}#mermaid-1579867443335 g.classGroup text{fill:#999;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:10px}#mermaid-1579867443335 g.classGroup rect{fill:#eee;stroke:#999}#mermaid-1579867443335 g.classGroup line{stroke:#999;stroke-width:1}#mermaid-1579867443335 .classLabel .box{stroke:none;stroke-width:0;fill:#eee;opacity:.5}#mermaid-1579867443335 .classLabel .label{fill:#999;font-size:10px}#mermaid-1579867443335 .relation{stroke:#999;stroke-width:1;fill:none}#mermaid-1579867443335 #compositionEnd,#mermaid-1579867443335 #compositionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579867443335 #aggregationEnd,#mermaid-1579867443335 #aggregationStart{fill:#eee;stroke:#999;stroke-width:1}#mermaid-1579867443335 #dependencyEnd,#mermaid-1579867443335 #dependencyStart,#mermaid-1579867443335 #extensionEnd,#mermaid-1579867443335 #extensionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579867443335 .branch-label,#mermaid-1579867443335 .commit-id,#mermaid-1579867443335 .commit-msg{fill:#d3d3d3;color:#d3d3d3}</style><style>#mermaid-1579867443335 {
color: rgb(0, 0, 0);
font: normal normal 400 normal 16px / normal "Times New Roman";
}</style><g></g><g><line id="actor0" x1="75" y1="5" x2="75" y2="796" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="0" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">ServerBuilder</tspan></text></g><g><line id="actor1" x1="275" y1="5" x2="275" y2="796" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="200" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">mio</tspan></text></g><g><line id="actor2" x1="475" y1="5" x2="475" y2="796" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="400" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">Accept</tspan></text></g><g><line id="actor3" x1="675" y1="5" x2="675" y2="796" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="600" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">WorkerClient</tspan></text></g><defs><marker id="arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path d="M 0,0 V 4 L6,2 Z"></path></marker></defs><defs><marker id="crosshead" markerWidth="15" markerHeight="8" orient="auto" refX="16" refY="4"><path fill="black" stroke="#000000" stroke-width="1px" d="M 9,2 V 6 L16,4 Z" style="stroke-dasharray: 0, 0;"></path><path fill="none" stroke="#000000" stroke-width="1px" d="M 0,1 L 6,7 M 6,1 L 0,7" style="stroke-dasharray: 0, 0;"></path></marker></defs><g><text x="275" y="93" class="messageText" style="text-anchor: middle;">start(socks, workers)</text><line x1="75" y1="100" x2="475" y2="100" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="375" y="153" class="messageText" style="text-anchor: middle;">mio::Poll::poll()</text><line x1="475" y1="160" x2="275" y2="160" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="213" class="messageText" style="text-anchor: middle;">process_*</text><path d="M 475,220 C 535,210 535,250 475,240" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></path></g><g><text x="475" y="298" class="messageText" style="text-anchor: middle;">backpressure</text><path d="M 475,305 C 535,295 535,335 475,325" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><text x="475" y="383" class="messageText" style="text-anchor: middle;">accept_one(Conn)</text><path d="M 475,390 C 535,380 535,420 475,410" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></path></g><g><text x="575" y="473" class="messageText" style="text-anchor: middle;">send(Conn)</text><line x1="475" y1="480" x2="675" y2="480" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="400" y="515" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="539" fill="black" class="noteText"><tspan x="416" fill="black">break loop</tspan></text></g><g><text x="275" y="599" class="messageText" style="text-anchor: middle;">worker_faulted(idx)</text><line x1="475" y1="606" x2="75" y2="606" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="634" class="messageText" style="text-anchor: middle;">remove worker, get next worker</text><path d="M 475,641 C 535,631 535,671 475,661" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><line x1="65" y1="490" x2="587.5859375" y2="490" class="loopLine"></line><line x1="587.5859375" y1="490" x2="587.5859375" y2="681" class="loopLine"></line><line x1="65" y1="681" x2="587.5859375" y2="681" class="loopLine"></line><line x1="65" y1="490" x2="65" y2="681" class="loopLine"></line><line x1="65" y1="561" x2="587.5859375" y2="561" class="loopLine" style="stroke-dasharray: 3, 3;"></line><polygon points="65,490 115,490 115,503 106.6,510 65,510" class="labelBox"></polygon><text x="72.5" y="505" fill="black" class="labelText"><tspan x="72.5" fill="black">alt</tspan></text><text x="326.29296875" y="505" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="326.29296875" fill="black">[ send(Conn) -&gt; Ok(_) ]</tspan></text><text x="326.29296875" y="576" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="326.29296875" fill="black">[ send(Conn) -&gt; Err(_) ]</tspan></text></g><g><line x1="55" y1="430" x2="685" y2="430" class="loopLine"></line><line x1="685" y1="430" x2="685" y2="691" class="loopLine"></line><line x1="55" y1="691" x2="685" y2="691" class="loopLine"></line><line x1="55" y1="430" x2="55" y2="691" class="loopLine"></line><polygon points="55,430 105,430 105,443 96.6,450 55,450" class="labelBox"></polygon><text x="62.5" y="445" fill="black" class="labelText"><tspan x="62.5" fill="black">loop</tspan></text><text x="370" y="445" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="370" fill="black">[ while exist WorkerClient ]</tspan></text></g><g><line x1="45" y1="170" x2="695" y2="170" class="loopLine"></line><line x1="695" y1="170" x2="695" y2="701" class="loopLine"></line><line x1="45" y1="701" x2="695" y2="701" class="loopLine"></line><line x1="45" y1="170" x2="45" y2="701" class="loopLine"></line><line x1="45" y1="260" x2="695" y2="260" class="loopLine" style="stroke-dasharray: 3, 3;"></line><line x1="45" y1="345" x2="695" y2="345" class="loopLine" style="stroke-dasharray: 3, 3;"></line><polygon points="45,170 95,170 95,183 86.6,190 45,190" class="labelBox"></polygon><text x="52.5" y="185" fill="black" class="labelText"><tspan x="52.5" fill="black">alt</tspan></text><text x="370" y="185" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="370" fill="black">[ poll() -&gt; TIMER | CMD ]</tspan></text><text x="370" y="275" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="370" fill="black">[ poll() -&gt; NOTIFY ]</tspan></text><text x="370" y="360" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="370" fill="black">[ poll() -&gt; OTHER(token) ]</tspan></text></g><g><line x1="35" y1="110" x2="705" y2="110" class="loopLine"></line><line x1="705" y1="110" x2="705" y2="711" class="loopLine"></line><line x1="35" y1="711" x2="705" y2="711" class="loopLine"></line><line x1="35" y1="110" x2="35" y2="711" class="loopLine"></line><polygon points="35,110 85,110 85,123 76.6,130 35,130" class="labelBox"></polygon><text x="42.5" y="125" fill="black" class="labelText"><tspan x="42.5" fill="black">loop</tspan></text><text x="370" y="125" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="370" fill="black">[ Continuous: poll ]</tspan></text></g><g><rect x="0" y="731" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="763.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">ServerBuilder</tspan></text></g><g><rect x="200" y="731" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="763.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">mio</tspan></text></g><g><rect x="400" y="731" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="763.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">Accept</tspan></text></g><g><rect x="600" y="731" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="763.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">WorkerClient</tspan></text></g></svg>