Files
blog_os/blog/content/edition-2/posts/12-async-await/async-state-machine-basic.svg
2020-12-16 14:56:36 +01:00

3 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" style="background-color: rgb(255, 255, 255);" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="606px" height="242px" viewBox="-0.5 -0.5 606 242" content="&lt;mxfile host=&quot;www.draw.io&quot; modified=&quot;2020-02-20T11:01:37.506Z&quot; agent=&quot;Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0&quot; version=&quot;12.7.2&quot; etag=&quot;HwI0NLJ7kJ7zfpw4Tht8&quot; type=&quot;google&quot;&gt;&lt;diagram id=&quot;zopQOOP2Sg-yPvX2lo6u&quot;&gt;7Vtbb6M4FP41kXYfGgEGSh6nt9mHWalSpZ3powMmsYbgCNw2mV+/NtiAbZIAIS1TTV6Kj41tzuU7nw90Bm43u68Z3K7/JRFKZo4V7WbgbuY4NgAB+8Ml+1ISWFYpWGU4EoNqwRP+hYRQDnvBEcqVgZSQhOKtKgxJmqKQKjKYZeRNHRaTRF11C1fIEDyFMDGl33FE10Jqy8fgHf8gvFqLpQNPdCxh+HOVkZdUrDdzQFz8yu4NlHOJ8fkaRuStIQL3M3CbEULLq83uFiVct1Jt5X0PB3qrfWcopV1ucMobXmHyIh79O8QUpysmJGmhOjKnOyp2S/dSQ8UzIj6LPQM3b2tM0dMWhrz3jfkEk63pJhHdMAuFjR2XNWOcJLckIVkxFYggCuKQyXOakZ+o0eOHAVrGvEeqyWKNkGxwKK4TuETJTaV0eW9KUsQXIil9gBuccDf8D2URTKEQi/3YDt9eglcpa4RMaYjdfiOUgjKKdgcVa1fmYmGAyAbRbM+GiBsc1ytvEREApOu8NfwJCNm64UqukEHhwqtq6tqM7EJYst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XmBpZbUrqbENuQzfSDbsNxAO3h44ATMFC39lUP/b0Y6oJVjgtXkXjZUr5mEg7lBMAfNqu5Y7x68y4CXURjzreP7AueNl5xvLHB0zHpq75cbU2dlgoGBc/Gy8QnbAbxceLLoOM7hTM6sEnR3LlPauHDqfDyces4l4JTlWOfAVzD+0vf8bnDqtcDp1Mgf0MnfYugRUSd/HetBffFTZ6un8BAszhs/On6adec/+HkIP52T+OkuwHlxUEGk5Syav0vgZYead+f6/4kPtjQ8C0LUjmfLwHO9kb4IAtfaucx5v8+vWj6e7J+LBr4bGFJz6JA+pLtMOn8Y7xN02O/8PkHDXVtPROMVFTt9kjmIt1hHbT40KDt5yYQ8wp23IOmhY1Xn4pKrvsVg61yEXxzyw6770sb35QusWf+3Szm8/pcicP8/&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><rect x="136.5" y="152.1" width="169" height="52" rx="12.48" ry="12.48" fill="#dae8fc" stroke="#6c8ebf" stroke-width="1.3" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 137px; margin-left: 106px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Waiting on foo.txt</div></div></div></foreignObject><text x="170" y="141" fill="#000000" font-family="Verdana" font-size="12px" text-anchor="middle">Waiting on foo.txt</text></switch></g><ellipse cx="578.5" cy="178.1" rx="14.3" ry="14.3" fill="#000000" stroke="#ff0000" stroke-width="1.3" pointer-events="all"/><ellipse cx="578.5" cy="178.1" rx="19.5" ry="19.5" fill="transparent" stroke="#ff0000" stroke-width="1.3" pointer-events="all"/><rect x="552.5" y="197.6" width="52" height="26" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 162px; margin-left: 426px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">End</div></div></div></foreignObject><text x="445" y="166" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">End</text></switch></g><rect x="344.5" y="152.1" width="169" height="52" rx="12.48" ry="12.48" fill="#ffe6cc" stroke="#d79b00" stroke-width="1.3" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 137px; margin-left: 266px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Waiting on bar.txt</div></div></div></foreignObject><text x="330" y="141" fill="#000000" font-family="Verdana" font-size="12px" text-anchor="middle">Waiting on bar.txt</text></switch></g><ellipse cx="26" cy="178.1" rx="14.3" ry="14.3" fill="#000000" stroke="#ff0000" stroke-width="1.3" transform="rotate(90,26,178.1)" pointer-events="all"/><rect x="0" y="197.6" width="52" height="26" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 162px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Start</div></div></div></foreignObject><text x="20" y="166" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">Start</text></switch></g><path d="M 26 162.93 L 26 87.1 Q 26 74.1 39 74.1 L 160.72 74.1" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 167.55 74.1 L 158.45 78.65 L 160.72 74.1 L 158.45 69.55 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 104px; margin-left: 40px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">poll()</div></div></div></foreignObject><text x="40" y="116" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">poll()</text></switch></g><path d="M 221 22.1 L 273 74.1 L 221 126.1 L 169 74.1 Z" fill="#ffffff" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 57px; margin-left: 131px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><div>foo.txt</div><div>ready?<br /></div></div></div></div></foreignObject><text x="170" y="61" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">foo.txt...</text></switch></g><path d="M 221 126.1 L 221 143.82" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 221 150.65 L 216.45 141.55 L 221 143.82 L 225.55 141.55 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 101px; margin-left: 176px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">no</div></div></div></foreignObject><text x="176" y="104" fill="#000000" font-family="Helvetica" font-size="12px">no</text></switch></g><path d="M 429 22.1 L 481 74.1 L 429 126.1 L 377 74.1 Z" fill="#ffffff" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 57px; margin-left: 291px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><div>bar.txt</div><div>ready?<br /></div></div></div></div></foreignObject><text x="330" y="61" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">bar.txt...</text></switch></g><path d="M 273 74.1 L 297.22 74.1" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 304.05 74.1 L 294.95 78.65 L 297.22 74.1 L 294.95 69.55 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 63px; margin-left: 219px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">yes</div></div></div></foreignObject><text x="219" y="75" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle">yes</text></switch></g><path d="M 428.84 126.1 L 428.84 143.82" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 428.84 150.65 L 424.29 141.55 L 428.84 143.82 L 433.39 141.55 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 101px; margin-left: 336px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">no</div></div></div></foreignObject><text x="336" y="104" fill="#000000" font-family="Helvetica" font-size="12px">no</text></switch></g><path d="M 481 74.1 L 565.5 74.1 Q 578.5 74.1 578.5 87.1 L 578.5 150.32" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 578.5 157.15 L 573.95 148.05 L 578.5 150.32 L 583.05 148.05 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-end; width: 1px; height: 1px; padding-top: 65px; margin-left: 398px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">yes</div></div></div></foreignObject><text x="398" y="77" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="end">y...</text></switch></g><path d="M 221 204.1 L 221 217.1 Q 221 230.1 208 230.1 L 130 230.1 Q 117 230.1 117 217.1 L 117 139.1 Q 117 126.1 127.07 117.88 L 167.58 84.84" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 172.87 80.53 L 168.69 89.81 L 167.58 84.84 L 162.94 82.76 Z" fill="#6c8ebf" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 168px; margin-left: 175px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">poll()</div></div></div></foreignObject><text x="175" y="171" fill="#000000" font-family="Helvetica" font-size="12px">p...</text></switch></g><path d="M 429 204.1 L 429 217.1 Q 429 230.1 416 230.1 L 338 230.1 Q 325 230.1 325 217.1 L 325 139.1 Q 325 126.1 335.1 117.92 L 375.97 84.82" fill="none" stroke="#d6b656" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 381.28 80.53 L 377.07 89.79 L 375.97 84.82 L 371.34 82.72 Z" fill="#d6b656" stroke="#d6b656" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(1.3)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 168px; margin-left: 335px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">poll()</div></div></div></foreignObject><text x="335" y="171" fill="#000000" font-family="Helvetica" font-size="12px">p...</text></switch></g><path d="M 325 54.6 L 344.5 74.1 L 325 93.6 L 305.5 74.1 Z" fill="#f8cecc" stroke="#b85450" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><path d="M 344.5 74.1 L 368.72 74.1" fill="none" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 375.55 74.1 L 366.45 78.65 L 368.72 74.1 L 366.45 69.55 Z" fill="#000000" stroke="#000000" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/><path d="M 325 54.6 L 325 22.1 Q 325 9.1 338 9.1 L 516.1 9.1 Q 529.1 9.1 529.1 22.1 L 529.1 67.12" fill="none" stroke="#b85450" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 529.1 73.95 L 524.55 64.85 L 529.1 67.12 L 533.65 64.85 Z" fill="#b85450" stroke="#b85450" stroke-width="1.3" stroke-miterlimit="10" pointer-events="all"/></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://desk.draw.io/support/solutions/articles/16000042487" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch></svg>