1
0
mirror of https://github.com/actix/actix-website synced 2024-11-24 08:43:01 +01:00
actix-website/static/img/diagrams/connection_request.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-1579870223874" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:1250px;" viewBox="-50 -10 1250 743"><style>#mermaid-1579870223874 .label{font-family:trebuchet ms,verdana,arial;color:#333}#mermaid-1579870223874 .node circle,#mermaid-1579870223874 .node ellipse,#mermaid-1579870223874 .node polygon,#mermaid-1579870223874 .node rect{fill:#eee;stroke:#999;stroke-width:1px}#mermaid-1579870223874 .node.clickable{cursor:pointer}#mermaid-1579870223874 .arrowheadPath{fill:#333}#mermaid-1579870223874 .edgePath .path{stroke:#666;stroke-width:1.5px}#mermaid-1579870223874 .edgeLabel{background-color:#fff}#mermaid-1579870223874 .cluster rect{fill:#eaf2fb!important;stroke:#26a!important;stroke-width:1px!important}#mermaid-1579870223874 .cluster text{fill:#333}#mermaid-1579870223874 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-1579870223874 .actor{stroke:#999;fill:#eee}#mermaid-1579870223874 text.actor{fill:#333;stroke:none}#mermaid-1579870223874 .actor-line{stroke:#666}#mermaid-1579870223874 .messageLine0{marker-end:"url(#arrowhead)"}#mermaid-1579870223874 .messageLine0,#mermaid-1579870223874 .messageLine1{stroke-width:1.5;stroke-dasharray:"2 2";stroke:#333}#mermaid-1579870223874 #arrowhead{fill:#333}#mermaid-1579870223874 #crosshead path{fill:#333!important;stroke:#333!important}#mermaid-1579870223874 .messageText{fill:#333;stroke:none}#mermaid-1579870223874 .labelBox{stroke:#999;fill:#eee}#mermaid-1579870223874 .labelText,#mermaid-1579870223874 .loopText{fill:#fff;stroke:none}#mermaid-1579870223874 .loopLine{stroke-width:2;stroke-dasharray:"2 2";marker-end:"url(#arrowhead)";stroke:#999}#mermaid-1579870223874 .note{stroke:#770;fill:#ffa}#mermaid-1579870223874 .noteText{fill:#000;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:14px}#mermaid-1579870223874 .section{stroke:none;opacity:.2}#mermaid-1579870223874 .section0,#mermaid-1579870223874 .section2{fill:#80b3e6}#mermaid-1579870223874 .section1,#mermaid-1579870223874 .section3{fill:#fff;opacity:.2}#mermaid-1579870223874 .sectionTitle0,#mermaid-1579870223874 .sectionTitle1,#mermaid-1579870223874 .sectionTitle2,#mermaid-1579870223874 .sectionTitle3{fill:#333}#mermaid-1579870223874 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px}#mermaid-1579870223874 .grid .tick{stroke:#e6e6e6;opacity:.3;shape-rendering:crispEdges}#mermaid-1579870223874 .grid path{stroke-width:0}#mermaid-1579870223874 .today{fill:none;stroke:#d42;stroke-width:2px}#mermaid-1579870223874 .task{stroke-width:2}#mermaid-1579870223874 .taskText{text-anchor:middle;font-size:11px}#mermaid-1579870223874 .taskTextOutsideRight{fill:#333;text-anchor:start;font-size:11px}#mermaid-1579870223874 .taskTextOutsideLeft{fill:#333;text-anchor:end;font-size:11px}#mermaid-1579870223874 .taskText0,#mermaid-1579870223874 .taskText1,#mermaid-1579870223874 .taskText2,#mermaid-1579870223874 .taskText3{fill:#fff}#mermaid-1579870223874 .task0,#mermaid-1579870223874 .task1,#mermaid-1579870223874 .task2,#mermaid-1579870223874 .task3{fill:#26a;stroke:#1a4d80}#mermaid-1579870223874 .taskTextOutside0,#mermaid-1579870223874 .taskTextOutside1,#mermaid-1579870223874 .taskTextOutside2,#mermaid-1579870223874 .taskTextOutside3{fill:#333}#mermaid-1579870223874 .active0,#mermaid-1579870223874 .active1,#mermaid-1579870223874 .active2,#mermaid-1579870223874 .active3{fill:#eee;stroke:#1a4d80}#mermaid-1579870223874 .activeText0,#mermaid-1579870223874 .activeText1,#mermaid-1579870223874 .activeText2,#mermaid-1579870223874 .activeText3{fill:#333!important}#mermaid-1579870223874 .done0,#mermaid-1579870223874 .done1,#mermaid-1579870223874 .done2,#mermaid-1579870223874 .done3{stroke:#666;fill:#bbb;stroke-width:2}#mermaid-1579870223874 .doneText0,#mermaid-1579870223874 .doneText1,#mermaid-1579870223874 .doneText2,#mermaid-1579870223874 .doneText3{fill:#333!important}#mermaid-1579870223874 .crit0,#mermaid-1579870223874 .crit1,#mermaid-1579870223874 .crit2,#mermaid-1579870223874 .crit3{stroke:#b1361b;fill:#d42;stroke-width:2}#mermaid-1579870223874 .activeCrit0,#mermaid-1579870223874 .activeCrit1,#mermaid-1579870223874 .activeCrit2,#mermaid-1579870223874 .activeCrit3{stroke:#b1361b;fill:#eee;stroke-width:2}#mermaid-1579870223874 .doneCrit0,#mermaid-1579870223874 .doneCrit1,#mermaid-1579870223874 .doneCrit2,#mermaid-1579870223874 .doneCrit3{stroke:#b1361b;fill:#bbb;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1579870223874 .activeCritText0,#mermaid-1579870223874 .activeCritText1,#mermaid-1579870223874 .activeCritText2,#mermaid-1579870223874 .activeCritText3,#mermaid-1579870223874 .doneCritText0,#mermaid-1579870223874 .doneCritText1,#mermaid-1579870223874 .doneCritText2,#mermaid-1579870223874 .doneCritText3{fill:#333!important}#mermaid-1579870223874 .titleText{text-anchor:middle;font-size:18px;fill:#333}#mermaid-1579870223874 g.classGroup text{fill:#999;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:10px}#mermaid-1579870223874 g.classGroup rect{fill:#eee;stroke:#999}#mermaid-1579870223874 g.classGroup line{stroke:#999;stroke-width:1}#mermaid-1579870223874 .classLabel .box{stroke:none;stroke-width:0;fill:#eee;opacity:.5}#mermaid-1579870223874 .classLabel .label{fill:#999;font-size:10px}#mermaid-1579870223874 .relation{stroke:#999;stroke-width:1;fill:none}#mermaid-1579870223874 #compositionEnd,#mermaid-1579870223874 #compositionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579870223874 #aggregationEnd,#mermaid-1579870223874 #aggregationStart{fill:#eee;stroke:#999;stroke-width:1}#mermaid-1579870223874 #dependencyEnd,#mermaid-1579870223874 #dependencyStart,#mermaid-1579870223874 #extensionEnd,#mermaid-1579870223874 #extensionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579870223874 .branch-label,#mermaid-1579870223874 .commit-id,#mermaid-1579870223874 .commit-msg{fill:#d3d3d3;color:#d3d3d3}</style><style>#mermaid-1579870223874 {
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="732" 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">HttpServer</tspan></text></g><g><line id="actor1" x1="275" y1="5" x2="275" y2="732" 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">HttpServiceHandler</tspan></text></g><g><line id="actor2" x1="475" y1="5" x2="475" y2="732" 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">HSHR</tspan></text></g><g><line id="actor3" x1="675" y1="5" x2="675" y2="732" 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">State</tspan></text></g><g><line id="actor4" x1="875" y1="5" x2="875" y2="732" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="800" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="875" dy="0">Dispatcher</tspan></text></g><g><line id="actor5" x1="1075" y1="5" x2="1075" y2="732" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="1000" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1075" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="1075" dy="0">Tokio</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><rect x="450" y="75" fill="#EDF2AE" stroke="#666" width="250" height="36" rx="0" ry="0" class="note"></rect><text x="446" y="99" fill="black" class="noteText"><tspan x="466" fill="black">HttpServiceHandlerResponse</tspan></text></g><g><text x="175" y="139" class="messageText" style="text-anchor: middle;">eventually build...</text><line x1="75" y1="146" x2="275" y2="146" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><text x="575" y="199" class="messageText" style="text-anchor: middle;">H1::Dispatcher::new()</text><line x1="275" y1="206" x2="875" y2="206" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="234" class="messageText" style="text-anchor: middle;">State::H1(Dispatcher)</text><line x1="275" y1="241" x2="675" y2="241" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="289" class="messageText" style="text-anchor: middle;">State::H2Handshake</text><line x1="275" y1="296" x2="675" y2="296" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><line x1="265" y1="156" x2="885" y2="156" class="loopLine"></line><line x1="885" y1="156" x2="885" y2="306" class="loopLine"></line><line x1="265" y1="306" x2="885" y2="306" class="loopLine"></line><line x1="265" y1="156" x2="265" y2="306" class="loopLine"></line><line x1="265" y1="251" x2="885" y2="251" class="loopLine" style="stroke-dasharray: 3, 3;"></line><polygon points="265,156 315,156 315,169 306.6,176 265,176" class="labelBox"></polygon><text x="272.5" y="171" fill="black" class="labelText"><tspan x="272.5" fill="black">alt</tspan></text><text x="575" y="171" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="575" fill="black">[ Protocol::HTTP1 ]</tspan></text><text x="575" y="266" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="575" fill="black">[ Protocol::HTTP2 ]</tspan></text></g><g><text x="375" y="334" class="messageText" style="text-anchor: middle;">HttpServiceHandlerResponse::new(State)</text><line x1="275" y1="341" x2="475" y2="341" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="675" y="369" class="messageText" style="text-anchor: middle;">StreamService-&gt;Tokio::spawn(HttpServiceHandlerResponse as Future)</text><line x1="275" y1="376" x2="1075" y2="376" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><text x="775" y="404" class="messageText" style="text-anchor: middle;">poll()</text><line x1="1075" y1="411" x2="475" y2="411" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="675" y="464" class="messageText" style="text-anchor: middle;">H2::Dispatcher::new(stream,services)</text><line x1="475" y1="471" x2="875" y2="471" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="499" class="messageText" style="text-anchor: middle;">poll()</text><path d="M 475,506 C 535,496 535,536 475,526" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><text x="675" y="584" class="messageText" style="text-anchor: middle;">poll()</text><line x1="475" y1="591" x2="875" y2="591" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><line x1="365" y1="421" x2="885" y2="421" class="loopLine"></line><line x1="885" y1="421" x2="885" y2="601" class="loopLine"></line><line x1="365" y1="601" x2="885" y2="601" class="loopLine"></line><line x1="365" y1="421" x2="365" y2="601" class="loopLine"></line><line x1="365" y1="546" x2="885" y2="546" class="loopLine" style="stroke-dasharray: 3, 3;"></line><polygon points="365,421 415,421 415,434 406.6,441 365,441" class="labelBox"></polygon><text x="372.5" y="436" fill="black" class="labelText"><tspan x="372.5" fill="black">alt</tspan></text><text x="625" y="436" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="625" fill="black">[ State::H2Handshake ]</tspan></text></g><g><rect x="800" y="611" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="796" y="635" fill="black" class="noteText"><tspan x="816" fill="black">requests loop</tspan></text></g><g><rect x="0" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">HttpServer</tspan></text></g><g><rect x="200" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">HttpServiceHandler</tspan></text></g><g><rect x="400" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">HSHR</tspan></text></g><g><rect x="600" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">State</tspan></text></g><g><rect x="800" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="875" dy="0">Dispatcher</tspan></text></g><g><rect x="1000" y="667" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1075" y="699.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="1075" dy="0">Tokio</tspan></text></g></svg>