Skip to content

Commit

Permalink
async: Add futures and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Mar 14, 2024
1 parent 633b8c4 commit f1d25ec
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 32 deletions.
5 changes: 3 additions & 2 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@
- [异步 async](async/index.md)
- [第一个 async 程序](async/async-dance.md)
- [理解 Futures 与 Tasks](async/futures-and-tasks.md)
- [标准库中的 future 模块](async/future-module.md)
- [标准库中的 task 模块](async/task-module.md)
- [理解 async/await](async/async-await.md)
- [生命周期与内存保持 Lifetimes and Pinning](async/lifetimes-pinning.md)
- [一次执行多个 Futures](async/multi-futures.md)
- [标准库中的 future 模块](async/future-module.md)
- [futures 库](async/futures-crate.md)
- [mio 库](async/mio.md)
- [运行时](async/runtime.md)
- [async 运行时](async/runtime.md)
- [tokio 库](async/runtime/tokio.md)
- [async-std 库](async/runtime/async-std.md)
- [smol 库](async/runtime/smol.md)
Expand Down
34 changes: 21 additions & 13 deletions src/async/.$async-dance.drawio.bkp
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
<mxfile host="Electron" modified="2024-03-14T12:56:23.476Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.1.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="V0tcVr3IdP2PH22wwuZs" version="23.1.5" type="device">
<mxfile host="Electron" modified="2024-03-14T15:23:36.754Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.1.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="RfgS-ij1sBTqF5HkNNTj" version="23.1.5" type="device">
<diagram name="Page-1" id="tZVp0-r1U8McQTlammkI">
<mxGraphModel dx="2284" dy="839" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<mxGraphModel dx="2240" dy="795" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="zyWgc2NWacgt1TY9s24u-3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="zyWgc2NWacgt1TY9s24u-1" target="zyWgc2NWacgt1TY9s24u-2">
<mxGeometry relative="1" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="zyWgc2NWacgt1TY9s24u-1" target="lP3_tZ8HHFPTm2W61l8j-2" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="480" y="255" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-1" value="learn_sing()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="180" y="230" width="200" height="60" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-1" value="learn_sing()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="180" y="230" width="170" height="50" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-2" value="sing_song()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="460" y="230" width="200" height="60" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-4" value="dance()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="180" y="330" width="150" height="50" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-4" value="dance()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="180" y="330" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-6" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;rounded=1;shadow=0;strokeColor=#264653;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxCell id="zyWgc2NWacgt1TY9s24u-6" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;rounded=1;shadow=0;strokeColor=#264653;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="110" y="260" width="50" height="100" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-7" value="join!()" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxCell id="zyWgc2NWacgt1TY9s24u-7" value="join!()" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="-20" y="270" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="lP3_tZ8HHFPTm2W61l8j-1" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="555" y="285" as="sourcePoint" />
<mxPoint x="555" y="285" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="lP3_tZ8HHFPTm2W61l8j-2" value="sing_song()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="440" y="230" width="170" height="50" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
Expand Down
49 changes: 49 additions & 0 deletions src/async/.$future-and-task.drawio.bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<mxfile host="Electron" modified="2024-03-14T15:21:14.320Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.1.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="ZAzHnr1c6v4YGfCKsg9e" version="23.1.5" type="device">
<diagram name="Page-1" id="_B0_zKmDxDtaBXKRs7CJ">
<mxGraphModel dx="1434" dy="839" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="LP3PkJa61_YIIx-bTDnN-9" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-1" target="LP3PkJa61_YIIx-bTDnN-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-1" value="runtime&lt;br style=&quot;font-size: 22px;&quot;&gt;executor" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="10" y="435" width="170" height="70" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-3" value="Future" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#82b366;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#d5e8d4;" vertex="1" parent="1">
<mxGeometry x="365" y="70" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-7" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-4" target="LP3PkJa61_YIIx-bTDnN-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-8" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-4" target="LP3PkJa61_YIIx-bTDnN-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-4" value="Future::poll()" style="rhombus;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#82b366;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#d5e8d4;" vertex="1" parent="1">
<mxGeometry x="330" y="405" width="170" height="130" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-11" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-5" target="LP3PkJa61_YIIx-bTDnN-10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-5" value="&lt;font style=&quot;font-size: 22px;&quot;&gt;Poll::Pending&lt;/font&gt;" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#82b366;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#d5e8d4;" vertex="1" parent="1">
<mxGeometry x="315" y="195" width="200" height="110" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-6" value="Poll::Ready&amp;lt;T&amp;gt;" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#82b366;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#d5e8d4;" vertex="1" parent="1">
<mxGeometry x="590" y="405" width="220" height="130" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-12" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-10" target="LP3PkJa61_YIIx-bTDnN-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-10" value="&lt;font style=&quot;font-size: 22px;&quot;&gt;Wake::wake()&lt;/font&gt;" style="rhombus;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="15" y="190" width="160" height="120" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-15" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="LP3PkJa61_YIIx-bTDnN-14" target="LP3PkJa61_YIIx-bTDnN-3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LP3PkJa61_YIIx-bTDnN-14" value="async fn" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="35" y="70" width="120" height="60" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
36 changes: 22 additions & 14 deletions src/async/async-dance.drawio
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
<mxfile host="Electron" modified="2024-03-14T13:00:53.072Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.1.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="-Vdm5VTeSmmZvql8PR-y" version="23.1.5" type="device">
<mxfile host="Electron" modified="2024-03-14T15:23:45.298Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.1.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="NZuhl2iPykXeu-D5l74D" version="23.1.5" type="device">
<diagram name="Page-1" id="tZVp0-r1U8McQTlammkI">
<mxGraphModel dx="2284" dy="839" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<mxGraphModel dx="2240" dy="795" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="zyWgc2NWacgt1TY9s24u-3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1" source="zyWgc2NWacgt1TY9s24u-1" target="zyWgc2NWacgt1TY9s24u-2">
<mxGeometry relative="1" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="zyWgc2NWacgt1TY9s24u-1" target="lP3_tZ8HHFPTm2W61l8j-2" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="480" y="255" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-1" value="learn_sing()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="180" y="230" width="200" height="60" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-1" value="learn_sing()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="180" y="230" width="170" height="50" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-2" value="sing_song()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="460" y="230" width="200" height="60" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-4" value="dance()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="180" y="330" width="150" height="50" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-4" value="dance()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="180" y="330" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-6" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;rounded=1;shadow=0;strokeColor=#264653;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxCell id="zyWgc2NWacgt1TY9s24u-6" value="" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;pointerEvents=1;rounded=1;shadow=0;strokeColor=#264653;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry x="110" y="260" width="50" height="100" as="geometry" />
</mxCell>
<mxCell id="zyWgc2NWacgt1TY9s24u-7" value="join!()" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="-20" y="270" width="120" height="80" as="geometry" />
<mxCell id="zyWgc2NWacgt1TY9s24u-7" value="join!()" style="ellipse;whiteSpace=wrap;html=1;rounded=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" parent="1" vertex="1">
<mxGeometry y="275" width="100" height="70" as="geometry" />
</mxCell>
<mxCell id="lP3_tZ8HHFPTm2W61l8j-1" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=28;fontColor=#264653;fontStyle=1;endArrow=block;endFill=1;fillColor=#264653;" edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="555" y="285" as="sourcePoint" />
<mxPoint x="555" y="285" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="lP3_tZ8HHFPTm2W61l8j-2" value="sing_song()" style="rounded=1;whiteSpace=wrap;html=1;shadow=0;strokeColor=#264653;strokeWidth=4;fontFamily=Ubuntu;fontSize=22;fontColor=#264653;fontStyle=1;fillColor=#2a9d8f;" vertex="1" parent="1">
<mxGeometry x="440" y="230" width="170" height="50" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
Expand Down
2 changes: 1 addition & 1 deletion src/async/async-dance.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ fn main() {
}
```

其中 `futures::join!()` 宏, 类似于 `.await`, 但它等待多个 futures 对象并发运行, 大致如下图如示:
其中 `futures::join!()` 宏, 类似于 `.await`, 但它等待多个 Future 对象并发运行, 大致如下图如示:

![futures join](async-dance.png)
Binary file modified src/async/async-dance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f1d25ec

Please sign in to comment.