<svg id="mermaid-1579870260436" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:1050px;" viewBox="-50 -10 1050 884"><style>#mermaid-1579870260436 .label{font-family:trebuchet ms,verdana,arial;color:#333}#mermaid-1579870260436 .node circle,#mermaid-1579870260436 .node ellipse,#mermaid-1579870260436 .node polygon,#mermaid-1579870260436 .node rect{fill:#eee;stroke:#999;stroke-width:1px}#mermaid-1579870260436 .node.clickable{cursor:pointer}#mermaid-1579870260436 .arrowheadPath{fill:#333}#mermaid-1579870260436 .edgePath .path{stroke:#666;stroke-width:1.5px}#mermaid-1579870260436 .edgeLabel{background-color:#fff}#mermaid-1579870260436 .cluster rect{fill:#eaf2fb!important;stroke:#26a!important;stroke-width:1px!important}#mermaid-1579870260436 .cluster text{fill:#333}#mermaid-1579870260436 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-1579870260436 .actor{stroke:#999;fill:#eee}#mermaid-1579870260436 text.actor{fill:#333;stroke:none}#mermaid-1579870260436 .actor-line{stroke:#666}#mermaid-1579870260436 .messageLine0{marker-end:"url(#arrowhead)"}#mermaid-1579870260436 .messageLine0,#mermaid-1579870260436 .messageLine1{stroke-width:1.5;stroke-dasharray:"2 2";stroke:#333}#mermaid-1579870260436 #arrowhead{fill:#333}#mermaid-1579870260436 #crosshead path{fill:#333!important;stroke:#333!important}#mermaid-1579870260436 .messageText{fill:#333;stroke:none}#mermaid-1579870260436 .labelBox{stroke:#999;fill:#eee}#mermaid-1579870260436 .labelText,#mermaid-1579870260436 .loopText{fill:#fff;stroke:none}#mermaid-1579870260436 .loopLine{stroke-width:2;stroke-dasharray:"2 2";marker-end:"url(#arrowhead)";stroke:#999}#mermaid-1579870260436 .note{stroke:#770;fill:#ffa}#mermaid-1579870260436 .noteText{fill:#000;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:14px}#mermaid-1579870260436 .section{stroke:none;opacity:.2}#mermaid-1579870260436 .section0,#mermaid-1579870260436 .section2{fill:#80b3e6}#mermaid-1579870260436 .section1,#mermaid-1579870260436 .section3{fill:#fff;opacity:.2}#mermaid-1579870260436 .sectionTitle0,#mermaid-1579870260436 .sectionTitle1,#mermaid-1579870260436 .sectionTitle2,#mermaid-1579870260436 .sectionTitle3{fill:#333}#mermaid-1579870260436 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px}#mermaid-1579870260436 .grid .tick{stroke:#e6e6e6;opacity:.3;shape-rendering:crispEdges}#mermaid-1579870260436 .grid path{stroke-width:0}#mermaid-1579870260436 .today{fill:none;stroke:#d42;stroke-width:2px}#mermaid-1579870260436 .task{stroke-width:2}#mermaid-1579870260436 .taskText{text-anchor:middle;font-size:11px}#mermaid-1579870260436 .taskTextOutsideRight{fill:#333;text-anchor:start;font-size:11px}#mermaid-1579870260436 .taskTextOutsideLeft{fill:#333;text-anchor:end;font-size:11px}#mermaid-1579870260436 .taskText0,#mermaid-1579870260436 .taskText1,#mermaid-1579870260436 .taskText2,#mermaid-1579870260436 .taskText3{fill:#fff}#mermaid-1579870260436 .task0,#mermaid-1579870260436 .task1,#mermaid-1579870260436 .task2,#mermaid-1579870260436 .task3{fill:#26a;stroke:#1a4d80}#mermaid-1579870260436 .taskTextOutside0,#mermaid-1579870260436 .taskTextOutside1,#mermaid-1579870260436 .taskTextOutside2,#mermaid-1579870260436 .taskTextOutside3{fill:#333}#mermaid-1579870260436 .active0,#mermaid-1579870260436 .active1,#mermaid-1579870260436 .active2,#mermaid-1579870260436 .active3{fill:#eee;stroke:#1a4d80}#mermaid-1579870260436 .activeText0,#mermaid-1579870260436 .activeText1,#mermaid-1579870260436 .activeText2,#mermaid-1579870260436 .activeText3{fill:#333!important}#mermaid-1579870260436 .done0,#mermaid-1579870260436 .done1,#mermaid-1579870260436 .done2,#mermaid-1579870260436 .done3{stroke:#666;fill:#bbb;stroke-width:2}#mermaid-1579870260436 .doneText0,#mermaid-1579870260436 .doneText1,#mermaid-1579870260436 .doneText2,#mermaid-1579870260436 .doneText3{fill:#333!important}#mermaid-1579870260436 .crit0,#mermaid-1579870260436 .crit1,#mermaid-1579870260436 .crit2,#mermaid-1579870260436 .crit3{stroke:#b1361b;fill:#d42;stroke-width:2}#mermaid-1579870260436 .activeCrit0,#mermaid-1579870260436 .activeCrit1,#mermaid-1579870260436 .activeCrit2,#mermaid-1579870260436 .activeCrit3{stroke:#b1361b;fill:#eee;stroke-width:2}#mermaid-1579870260436 .doneCrit0,#mermaid-1579870260436 .doneCrit1,#mermaid-1579870260436 .doneCrit2,#mermaid-1579870260436 .doneCrit3{stroke:#b1361b;fill:#bbb;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1579870260436 .activeCritText0,#mermaid-1579870260436 .activeCritText1,#mermaid-1579870260436 .activeCritText2,#mermaid-1579870260436 .activeCritText3,#mermaid-1579870260436 .doneCritText0,#mermaid-1579870260436 .doneCritText1,#mermaid-1579870260436 .doneCritText2,#mermaid-1579870260436 .doneCritText3{fill:#333!important}#mermaid-1579870260436 .titleText{text-anchor:middle;font-size:18px;fill:#333}#mermaid-1579870260436 g.classGroup text{fill:#999;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:10px}#mermaid-1579870260436 g.classGroup rect{fill:#eee;stroke:#999}#mermaid-1579870260436 g.classGroup line{stroke:#999;stroke-width:1}#mermaid-1579870260436 .classLabel .box{stroke:none;stroke-width:0;fill:#eee;opacity:.5}#mermaid-1579870260436 .classLabel .label{fill:#999;font-size:10px}#mermaid-1579870260436 .relation{stroke:#999;stroke-width:1;fill:none}#mermaid-1579870260436 #compositionEnd,#mermaid-1579870260436 #compositionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579870260436 #aggregationEnd,#mermaid-1579870260436 #aggregationStart{fill:#eee;stroke:#999;stroke-width:1}#mermaid-1579870260436 #dependencyEnd,#mermaid-1579870260436 #dependencyStart,#mermaid-1579870260436 #extensionEnd,#mermaid-1579870260436 #extensionStart{fill:#999;stroke:#999;stroke-width:1}#mermaid-1579870260436 .branch-label,#mermaid-1579870260436 .commit-id,#mermaid-1579870260436 .commit-msg{fill:#d3d3d3;color:#d3d3d3}</style><style>#mermaid-1579870260436 {
    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="873" 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">WorkerClient</tspan></text></g><g><line id="actor1" x1="275" y1="5" x2="275" y2="873" 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">Worker</tspan></text></g><g><line id="actor2" x1="475" y1="5" x2="475" y2="873" 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">StreamService</tspan></text></g><g><line id="actor3" x1="675" y1="5" x2="675" y2="873" 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">HttpServiceHandler</tspan></text></g><g><line id="actor4" x1="875" y1="5" x2="875" y2="873" 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">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="400" y="75" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="99" fill="black" class="noteText"><tspan x="416" fill="black">(token, web::App)</tspan></text></g><g><text x="575" y="139" class="messageText" style="text-anchor: middle;">poll()</text><line x1="875" 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="175" y="224" class="messageText" style="text-anchor: middle;">rx.poll_next()</text><line x1="275" y1="231" x2="75" y2="231" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="175" y="259" class="messageText" style="text-anchor: middle;">WorkerCommand(Conn)</text><line x1="75" y1="266" x2="275" y2="266" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="275" y="294" class="messageText" style="text-anchor: middle;">check_readiness()</text><path d="M 275,301 C 335,291 335,331 275,321" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><rect x="250" y="366" fill="#EDF2AE" stroke="#666" width="250" height="36" rx="0" ry="0" class="note"></rect><text x="246" y="390" fill="black" class="noteText"><tspan x="266" fill="black">Worker::services[Conn.token]</tspan></text></g><g><text x="375" y="430" class="messageText" style="text-anchor: middle;">call(ServerMessage::Connect(stream))</text><line x1="275" y1="437" x2="475" y2="437" 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="465" class="messageText" style="text-anchor: middle;">call(stream)</text><line x1="475" y1="472" x2="675" y2="472" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="575" y="500" class="messageText" style="text-anchor: middle;">HttpServiceHandlerResponse as Future</text><line x1="675" y1="507" x2="475" y2="507" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="675" y="535" class="messageText" style="text-anchor: middle;">spawn(HttpServiceHandlerResponse)</text><line x1="475" y1="542" x2="875" y2="542" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="275" y="590" class="messageText" style="text-anchor: middle;">WorkerState::Unavailable</text><path d="M 275,597 C 335,587 335,627 275,617" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></path></g><g><text x="275" y="675" class="messageText" style="text-anchor: middle;">WorkerState::Restarting</text><path d="M 275,682 C 335,672 335,712 275,702" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></path></g><g><line x1="165" y1="341" x2="885" y2="341" class="loopLine"></line><line x1="885" y1="341" x2="885" y2="722" class="loopLine"></line><line x1="165" y1="722" x2="885" y2="722" class="loopLine"></line><line x1="165" y1="341" x2="165" y2="722" class="loopLine"></line><line x1="165" y1="552" x2="885" y2="552" class="loopLine" style="stroke-dasharray: 3, 3;"></line><line x1="165" y1="637" x2="885" y2="637" class="loopLine" style="stroke-dasharray: 3, 3;"></line><polygon points="165,341 215,341 215,354 206.6,361 165,361" class="labelBox"></polygon><text x="172.5" y="356" fill="black" class="labelText"><tspan x="172.5" fill="black">alt</tspan></text><text x="525" y="356" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="525" fill="black">[ check_readiness() -&gt; Ok(true) ]</tspan></text><text x="525" y="567" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="525" fill="black">[ check_readiness() -&gt; Ok(false) ]</tspan></text><text x="525" y="652" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="525" fill="black">[ check_readiness() -&gt; Err(token,idx) ]</tspan></text></g><g><line x1="65" y1="181" x2="895" y2="181" class="loopLine"></line><line x1="895" y1="181" x2="895" y2="732" class="loopLine"></line><line x1="65" y1="732" x2="895" y2="732" class="loopLine"></line><line x1="65" y1="181" x2="65" y2="732" class="loopLine"></line><polygon points="65,181 115,181 115,194 106.6,201 65,201" class="labelBox"></polygon><text x="72.5" y="196" fill="black" class="labelText"><tspan x="72.5" fill="black">loop</tspan></text><text x="480" y="196" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="480" fill="black">[  ]</tspan></text></g><g><line x1="55" y1="156" x2="905" y2="156" class="loopLine"></line><line x1="905" y1="156" x2="905" y2="742" class="loopLine"></line><line x1="55" y1="742" x2="905" y2="742" class="loopLine"></line><line x1="55" y1="156" x2="55" y2="742" class="loopLine"></line><polygon points="55,156 105,156 105,169 96.6,176 55,176" class="labelBox"></polygon><text x="62.5" y="171" fill="black" class="labelText"><tspan x="62.5" fill="black">alt</tspan></text><text x="480" y="171" fill="black" class="loopText" style="text-anchor: middle;"><tspan x="480" fill="black">[ WorkerState::Available ]</tspan></text></g><g><rect x="600" y="752" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="596" y="776" fill="black" class="noteText"><tspan x="616" fill="black">process connection</tspan></text></g><g><rect x="0" y="808" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="840.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">WorkerClient</tspan></text></g><g><rect x="200" y="808" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="840.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">Worker</tspan></text></g><g><rect x="400" y="808" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="840.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">StreamService</tspan></text></g><g><rect x="600" y="808" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="840.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">HttpServiceHandler</tspan></text></g><g><rect x="800" y="808" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="840.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="875" dy="0">Tokio</tspan></text></g></svg>