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

3 lines
17 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="496px" height="470px" viewBox="-0.5 -0.5 496 470" content="&lt;mxfile host=&quot;www.draw.io&quot; modified=&quot;2020-02-13T13:51:56.404Z&quot; agent=&quot;Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0&quot; version=&quot;12.7.0&quot; etag=&quot;oBy8OeDkgdxqSCFINxip&quot; type=&quot;google&quot;&gt;&lt;diagram id=&quot;A1QaQleqtC10iOLgYA2H&quot;&gt;7Ztbb6M4GIZ/TaTdi42MOcRcTtJ25mJXGm2lPVyNHDAJqsGRcZpkf/3aYM4kJQk5aJpWGuEP+Ax+H8zL587InEXbrxyvln8wn9ARBP52ZD6NIHSRIf9VgV0WcJxJFljw0M9CRhl4Df8jOgh0dB36JKkdKBijIlzVgx6LY+KJWgxzzjb1wwJG672u8IK0Aq8epu3o36EvljpqAFDu+EbCxVJ3jWy9Y469twVn61j3N4JmkP5kuyOc59LHJ0vss00lZD6PzBlnTGRb0XZGqBrafNiy81727C2um5NY9DkBZie8Y7rWt/4SykGA4HWXCBLpixS7fGDk9a7U5jqiv4cBoWEsW9MV4WFEBOFyD9Xh72VsulmGgryusKdO3UhiZGwpIipbhtyUKgosT+FFm1K8SsJ52iuQEU68NU/Cd/InSTJYVJStheppVkCQHqoGn/g6VTG+IM0bhZ7epnhO6LRQa8YoU93HLL2hRHD2VkivEgXyGl9wFFJF9F+E+zjGOqzxNaR4U0zDRSwbnhz/9NazTHl6icM0/ZV79MgTLsh2r3pGwYR81AiTA8p38hB9ArQ0Rv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+3IhjXsuMwyxKgQ/3TLDXUhcaHeFlQnYXpl4SHx5iYvi0gcSG2gAieFD4ltIfLn1YNks/yQ+M1vlfzswn/8H&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><rect x="182" y="0" width="130" height="52" rx="7.8" ry="7.8" fill="#ffffff" stroke="#b3b3b3" stroke-width="1.3" pointer-events="all"/><path d="M 247 52 L 247 468" fill="none" stroke="#b3b3b3" stroke-width="1.3" stroke-miterlimit="10" stroke-dasharray="3.9000000000000004 3.9000000000000004" 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: 98px; height: 1px; padding-top: 20px; margin-left: 141px;"><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; ">File System</div></div></div></foreignObject><text x="190" y="24" fill="#000000" font-family="Verdana" font-size="12px" text-anchor="middle">File System</text></switch></g><rect x="240.5" y="130" width="13" height="78" fill="#ffffff" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="240.5" y="340.6" width="13" height="78" fill="#ffffff" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="0" y="0" width="130" height="52" rx="7.8" ry="7.8" fill="#ffffff" stroke="#b3b3b3" stroke-width="1.3" pointer-events="all"/><path d="M 65 52 L 65 468" fill="none" stroke="#b3b3b3" stroke-width="1.3" stroke-miterlimit="10" stroke-dasharray="3.9000000000000004 3.9000000000000004" 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: 98px; height: 1px; padding-top: 20px; 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: Verdana; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">main</div></div></div></foreignObject><text x="50" y="24" fill="#000000" font-family="Verdana" font-size="12px" text-anchor="middle">main</text></switch></g><path d="M 71.5 129.57 L 227.5 129.57 Q 240.5 129.57 235.22 129.77 L 229.95 129.97" fill="none" stroke="#d79b00" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 239.05 130 L 229.93 134.52 L 229.96 125.42 Z" fill="#d79b00" stroke="#d79b00" 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-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 97px; margin-left: 120px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #D79B00; line-height: 1.2; pointer-events: all; white-space: nowrap; ">read_file()</div></div></div></foreignObject><text x="120" y="97" fill="#D79B00" font-family="Verdana" font-size="12px" text-anchor="middle">read_file()</text></switch></g><path d="M 240.59 207.92 L 74.5 207.92" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 84.74 202.07 L 73.04 207.92 L 84.74 213.77" fill="none" 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 flex-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 157px; margin-left: 120px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #6C8EBF; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">return File</div></div></div></foreignObject><text x="120" y="157" fill="#6C8EBF" font-family="Helvetica" font-size="11px" text-anchor="middle">return File</text></switch></g><rect x="364" y="0" width="130" height="52" rx="7.8" ry="7.8" fill="#ffffff" stroke="#b3b3b3" stroke-width="1.3" pointer-events="all"/><path d="M 429 52 L 429 468" fill="none" stroke="#b3b3b3" stroke-width="1.3" stroke-miterlimit="10" stroke-dasharray="3.9000000000000004 3.9000000000000004" 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: 98px; height: 1px; padding-top: 20px; margin-left: 281px;"><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; ">foo</div></div></div></foreignObject><text x="330" y="24" fill="#000000" font-family="Verdana" font-size="12px" text-anchor="middle">foo</text></switch></g><rect x="422.5" y="234" width="13" height="39" fill="#ffffff" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="422.5" y="390" width="13" height="39" fill="#ffffff" stroke="#000000" stroke-width="1.3" pointer-events="all"/><path d="M 65 234 L 65 233.78 Q 65 233.57 78 233.57 L 409.44 233.57 Q 422.44 233.57 417.16 233.81 L 411.88 234.06" fill="none" stroke="#d79b00" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 420.98 234.08 L 411.88 238.61 L 411.89 229.51 Z" fill="#d79b00" stroke="#d79b00" 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-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 177px; margin-left: 261px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #D79B00; line-height: 1.2; pointer-events: all; white-space: nowrap; ">foo()</div></div></div></foreignObject><text x="261" y="177" fill="#D79B00" font-family="Verdana" font-size="12px" text-anchor="middle">foo()</text></switch></g><path d="M 429 273 L 74.41 273" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 84.65 267.15 L 72.95 273 L 84.65 278.85" fill="none" 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 flex-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 207px; margin-left: 260px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #6C8EBF; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">return</div></div></div></foreignObject><text x="260" y="207" fill="#6C8EBF" font-family="Helvetica" font-size="11px" text-anchor="middle">return</text></switch></g><path d="M 71.5 340.6 L 71.5 340.6 Q 71.5 340.6 84.5 340.6 L 229.95 340.6" fill="none" stroke="#d79b00" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 239.05 340.6 L 229.95 345.15 L 229.95 336.05 Z" fill="#d79b00" stroke="#d79b00" 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-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 259px; margin-left: 120px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #D79B00; line-height: 1.2; pointer-events: all; white-space: nowrap; ">async_read_file()</div></div></div></foreignObject><text x="120" y="259" fill="#D79B00" font-family="Verdana" font-size="12px" text-anchor="middle">async_read_file()</text></switch></g><path d="M 240.5 364 L 74.41 364" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 84.65 358.15 L 72.95 364 L 84.65 369.85" fill="none" 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 flex-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 277px; margin-left: 120px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #6C8EBF; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">return Future</div></div></div></foreignObject><text x="120" y="277" fill="#6C8EBF" font-family="Helvetica" font-size="11px" text-anchor="middle">return Future</text></switch></g><path d="M 68.29 391.3 L 68.29 391.52 Q 68.29 391.73 81.29 391.73 L 411.95 391.73" fill="none" stroke="#d79b00" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 421.05 391.73 L 411.95 396.28 L 411.95 387.18 Z" fill="#d79b00" stroke="#d79b00" 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-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 298px; margin-left: 260px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Verdana; color: #D79B00; line-height: 1.2; pointer-events: all; white-space: nowrap; ">foo()</div></div></div></foreignObject><text x="260" y="298" fill="#D79B00" font-family="Verdana" font-size="12px" text-anchor="middle">foo()</text></switch></g><path d="M 239.2 418.6 L 74.5 418.78" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" stroke-dasharray="3.9000000000000004 3.9000000000000004" pointer-events="stroke"/><path d="M 84.74 412.92 L 73.04 418.78 L 84.75 424.62" fill="none" 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 flex-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 319px; margin-left: 120px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #6C8EBF; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">File available</div></div></div></foreignObject><text x="120" y="319" fill="#6C8EBF" font-family="Helvetica" font-size="11px" text-anchor="middle">File available</text></switch></g><path d="M 425.75 429 L 74.21 428.81" fill="none" stroke="#6c8ebf" stroke-width="1.3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 84.46 422.96 L 72.76 428.81 L 84.46 434.66" fill="none" 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 flex-end; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 327px; margin-left: 261px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: #6C8EBF; line-height: 1.2; pointer-events: all; background-color: #ffffff; white-space: nowrap; ">return</div></div></div></foreignObject><text x="261" y="327" fill="#6C8EBF" font-family="Helvetica" font-size="11px" text-anchor="middle">return</text></switch></g><rect x="58.5" y="91" width="13" height="364" fill="#ffffff" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="58.5" y="130" width="13" height="78" fill="#f8cecc" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="58.5" y="234" width="13" height="39" fill="#f8cecc" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="58.5" y="340.6" width="13" height="23.4" fill="#f8cecc" stroke="#000000" stroke-width="1.3" pointer-events="all"/><rect x="58.5" y="390" width="13" height="39" fill="#f8cecc" stroke="#000000" stroke-width="1.3" 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>