blog/asyncio/awaitkwd1.svg (view raw)
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 width="640"
13 height="480"
14 viewBox="0 0 169.33333 127"
15 version="1.1"
16 id="svg8"
17 inkscape:version="0.92.2 2405546, 2018-03-11"
18 sodipodi:docname="awaitkwd1.svg">
19 <defs
20 id="defs2">
21 <marker
22 inkscape:stockid="Arrow1Lend"
23 orient="auto"
24 refY="0.0"
25 refX="0.0"
26 id="marker2498"
27 style="overflow:visible;"
28 inkscape:isstock="true">
29 <path
30 id="path2496"
31 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
32 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
33 transform="scale(0.8) rotate(180) translate(12.5,0)" />
34 </marker>
35 <marker
36 inkscape:stockid="Arrow1Lend"
37 orient="auto"
38 refY="0.0"
39 refX="0.0"
40 id="marker2434"
41 style="overflow:visible;"
42 inkscape:isstock="true">
43 <path
44 id="path2432"
45 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
46 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
47 transform="scale(0.8) rotate(180) translate(12.5,0)" />
48 </marker>
49 <marker
50 inkscape:stockid="Arrow1Lend"
51 orient="auto"
52 refY="0.0"
53 refX="0.0"
54 id="marker2376"
55 style="overflow:visible;"
56 inkscape:isstock="true">
57 <path
58 id="path2374"
59 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
60 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
61 transform="scale(0.8) rotate(180) translate(12.5,0)" />
62 </marker>
63 <marker
64 inkscape:isstock="true"
65 style="overflow:visible;"
66 id="marker2306"
67 refX="0.0"
68 refY="0.0"
69 orient="auto"
70 inkscape:stockid="Arrow1Lend"
71 inkscape:collect="always">
72 <path
73 transform="scale(0.8) rotate(180) translate(12.5,0)"
74 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
75 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
76 id="path2304" />
77 </marker>
78 <marker
79 inkscape:stockid="Arrow1Lend"
80 orient="auto"
81 refY="0.0"
82 refX="0.0"
83 id="marker2035"
84 style="overflow:visible;"
85 inkscape:isstock="true"
86 inkscape:collect="always">
87 <path
88 id="path2033"
89 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
90 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
91 transform="scale(0.8) rotate(180) translate(12.5,0)" />
92 </marker>
93 <marker
94 inkscape:isstock="true"
95 style="overflow:visible;"
96 id="marker1920"
97 refX="0.0"
98 refY="0.0"
99 orient="auto"
100 inkscape:stockid="Arrow1Lend">
101 <path
102 transform="scale(0.8) rotate(180) translate(12.5,0)"
103 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
104 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
105 id="path1918" />
106 </marker>
107 <marker
108 inkscape:isstock="true"
109 style="overflow:visible;"
110 id="marker1441"
111 refX="0.0"
112 refY="0.0"
113 orient="auto"
114 inkscape:stockid="Arrow1Lend"
115 inkscape:collect="always">
116 <path
117 transform="scale(0.8) rotate(180) translate(12.5,0)"
118 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
119 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
120 id="path1439" />
121 </marker>
122 <marker
123 inkscape:stockid="Arrow1Lend"
124 orient="auto"
125 refY="0.0"
126 refX="0.0"
127 id="marker1399"
128 style="overflow:visible;"
129 inkscape:isstock="true"
130 inkscape:collect="always">
131 <path
132 id="path1397"
133 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
134 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
135 transform="scale(0.8) rotate(180) translate(12.5,0)" />
136 </marker>
137 <marker
138 inkscape:isstock="true"
139 style="overflow:visible;"
140 id="marker1363"
141 refX="0.0"
142 refY="0.0"
143 orient="auto"
144 inkscape:stockid="Arrow1Lend"
145 inkscape:collect="always">
146 <path
147 transform="scale(0.8) rotate(180) translate(12.5,0)"
148 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
149 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
150 id="path1361" />
151 </marker>
152 <marker
153 inkscape:stockid="Arrow1Lend"
154 orient="auto"
155 refY="0.0"
156 refX="0.0"
157 id="Arrow1Lend"
158 style="overflow:visible;"
159 inkscape:isstock="true"
160 inkscape:collect="always">
161 <path
162 id="path1074"
163 d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
164 style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
165 transform="scale(0.8) rotate(180) translate(12.5,0)" />
166 </marker>
167 </defs>
168 <sodipodi:namedview
169 id="base"
170 pagecolor="#ffffff"
171 bordercolor="#666666"
172 borderopacity="1.0"
173 inkscape:pageopacity="0.0"
174 inkscape:pageshadow="2"
175 inkscape:zoom="0.98994949"
176 inkscape:cx="180.99756"
177 inkscape:cy="228.4128"
178 inkscape:document-units="mm"
179 inkscape:current-layer="layer1"
180 showgrid="false"
181 units="px"
182 inkscape:window-width="1366"
183 inkscape:window-height="739"
184 inkscape:window-x="0"
185 inkscape:window-y="0"
186 inkscape:window-maximized="1" />
187 <metadata
188 id="metadata5">
189 <rdf:RDF>
190 <cc:Work
191 rdf:about="">
192 <dc:format>image/svg+xml</dc:format>
193 <dc:type
194 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
195 <dc:title />
196 </cc:Work>
197 </rdf:RDF>
198 </metadata>
199 <g
200 inkscape:label="Layer 1"
201 inkscape:groupmode="layer"
202 id="layer1"
203 transform="translate(0,-169.99997)">
204 <text
205 xml:space="preserve"
206 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
207 x="8.8198938"
208 y="183.27678"
209 id="text831"><tspan
210 sodipodi:role="line"
211 id="tspan829"
212 x="8.8198938"
213 y="192.64055"
214 style="stroke-width:0.26458332" /></text>
215 <g
216 id="g929"
217 transform="translate(-3.8334857,-1.0690781)">
218 <rect
219 y="173.66089"
220 x="99.108299"
221 height="59.932461"
222 width="71.760002"
223 id="rect812"
224 style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
225 <rect
226 y="175.69913"
227 x="101.14654"
228 height="9.8860025"
229 width="39.184521"
230 id="rect827"
231 style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
232 <text
233 id="text835"
234 y="183.15857"
235 x="102.76424"
236 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897"
237 xml:space="preserve"><tspan
238 style="stroke-width:0.17793897"
239 y="183.15857"
240 x="102.76424"
241 id="tspan833"
242 sodipodi:role="line">method 1</tspan></text>
243 <text
244 id="text848"
245 y="190.75735"
246 x="101.92492"
247 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042"
248 xml:space="preserve"><tspan
249 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
250 y="190.75735"
251 x="101.92492"
252 id="tspan846"
253 sodipodi:role="line">async def m1():</tspan><tspan
254 id="tspan850"
255 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
256 y="196.39587"
257 x="101.92492"
258 sodipodi:role="line"> prepare request</tspan><tspan
259 id="tspan852"
260 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
261 y="202.03439"
262 x="101.92492"
263 sodipodi:role="line"> await send request</tspan><tspan
264 id="tspan854"
265 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
266 y="207.67291"
267 x="101.92492"
268 sodipodi:role="line" /><tspan
269 id="tspan856"
270 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
271 y="213.31145"
272 x="101.92492"
273 sodipodi:role="line"> await receive request</tspan><tspan
274 id="tspan860"
275 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
276 y="218.94997"
277 x="101.92492"
278 sodipodi:role="line" /><tspan
279 id="tspan858"
280 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
281 y="224.58849"
282 x="101.92492"
283 sodipodi:role="line"> process request</tspan><tspan
284 id="tspan862"
285 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
286 y="230.22701"
287 x="101.92492"
288 sodipodi:role="line"> return result</tspan></text>
289 </g>
290 <g
291 transform="translate(-3.8334857,60.867907)"
292 id="g957">
293 <rect
294 style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
295 id="rect931"
296 width="71.760002"
297 height="59.932461"
298 x="99.108299"
299 y="173.66089" />
300 <rect
301 style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
302 id="rect933"
303 width="39.184521"
304 height="9.8860025"
305 x="101.14654"
306 y="175.69913" />
307 <text
308 xml:space="preserve"
309 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897"
310 x="102.76424"
311 y="183.15857"
312 id="text937"><tspan
313 sodipodi:role="line"
314 id="tspan935"
315 x="102.76424"
316 y="183.15857"
317 style="stroke-width:0.17793897">method 2</tspan></text>
318 <text
319 xml:space="preserve"
320 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042"
321 x="101.92492"
322 y="190.75735"
323 id="text955"><tspan
324 sodipodi:role="line"
325 id="tspan939"
326 x="101.92492"
327 y="190.75735"
328 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042">async def m2():</tspan><tspan
329 sodipodi:role="line"
330 x="101.92492"
331 y="196.39587"
332 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
333 id="tspan941"> prepare parameters</tspan><tspan
334 sodipodi:role="line"
335 x="101.92492"
336 y="202.03439"
337 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
338 id="tspan943"> await send query</tspan><tspan
339 sodipodi:role="line"
340 x="101.92492"
341 y="207.67291"
342 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
343 id="tspan945" /><tspan
344 sodipodi:role="line"
345 x="101.92492"
346 y="213.31145"
347 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
348 id="tspan947"> await receive answer</tspan><tspan
349 sodipodi:role="line"
350 x="101.92492"
351 y="218.94997"
352 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
353 id="tspan949" /><tspan
354 sodipodi:role="line"
355 x="101.92492"
356 y="224.58849"
357 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
358 id="tspan951"> process answer</tspan><tspan
359 sodipodi:role="line"
360 x="101.92492"
361 y="230.22701"
362 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042"
363 id="tspan953"> return result</tspan></text>
364 </g>
365 <rect
366 style="opacity:1;fill:#faffb5;fill-opacity:1;stroke:#000000;stroke-width:0.26830563;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
367 id="rect959"
368 width="87.068367"
369 height="121.70461"
370 x="2.6476943"
371 y="172.26968" />
372 <rect
373 y="174.00694"
374 x="3.9172246"
375 height="9.8860025"
376 width="39.184525"
377 id="rect963"
378 style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
379 <text
380 id="text967"
381 y="180.99866"
382 x="4.7331147"
383 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897"
384 xml:space="preserve"><tspan
385 style="stroke-width:0.17793897"
386 y="180.99866"
387 x="4.7331147"
388 id="tspan965"
389 sodipodi:role="line">event loop</tspan></text>
390 <text
391 xml:space="preserve"
392 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.54473734px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.16361843"
393 x="6.6373014"
394 y="190.92131"
395 id="text1043"><tspan
396 sodipodi:role="line"
397 id="tspan1041"
398 x="6.6373014"
399 y="190.92131"
400 style="stroke-width:0.16361843">no events</tspan><tspan
401 sodipodi:role="line"
402 x="6.6373014"
403 y="199.10223"
404 style="stroke-width:0.16361843"
405 id="tspan1045">enter m1</tspan><tspan
406 sodipodi:role="line"
407 x="6.6373014"
408 y="207.28316"
409 style="stroke-width:0.16361843"
410 id="tspan1047">pause m1</tspan><tspan
411 sodipodi:role="line"
412 x="6.6373014"
413 y="215.46408"
414 style="stroke-width:0.16361843"
415 id="tspan1049">enter m2</tspan><tspan
416 sodipodi:role="line"
417 x="6.6373014"
418 y="223.645"
419 style="stroke-width:0.16361843"
420 id="tspan1051">pause m2</tspan><tspan
421 sodipodi:role="line"
422 x="6.6373014"
423 y="231.82591"
424 style="stroke-width:0.16361843"
425 id="tspan1053">check events</tspan><tspan
426 sodipodi:role="line"
427 x="6.6373014"
428 y="240.00684"
429 style="stroke-width:0.16361843"
430 id="tspan1055">resume m2</tspan><tspan
431 sodipodi:role="line"
432 x="6.6373014"
433 y="248.18776"
434 style="stroke-width:0.16361843"
435 id="tspan1057">pause m2</tspan><tspan
436 sodipodi:role="line"
437 x="6.6373014"
438 y="256.36868"
439 style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1"
440 id="tspan1059">check events</tspan><tspan
441 sodipodi:role="line"
442 x="6.6373014"
443 y="264.54959"
444 style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1"
445 id="tspan1061">resume m1</tspan><tspan
446 sodipodi:role="line"
447 x="6.6373014"
448 y="272.73053"
449 style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1"
450 id="tspan1063">pause m1</tspan><tspan
451 sodipodi:role="line"
452 x="6.6373014"
453 y="280.91144"
454 style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1"
455 id="tspan1065">resume m2</tspan><tspan
456 sodipodi:role="line"
457 x="6.6373014"
458 y="289.09238"
459 style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1"
460 id="tspan1067">...</tspan></text>
461 <path
462 style="fill:none;stroke:#000000;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Lend)"
463 d="m 39.288619,196.50663 65.748301,-3.20724"
464 id="path1069"
465 inkscape:connector-curvature="0" />
466 <path
467 style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1363)"
468 d="M 106.96726,199.48211 42.144344,204.3958"
469 id="path1353"
470 inkscape:connector-curvature="0" />
471 <path
472 style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1399)"
473 d="m 39.309524,212.71128 64.391056,42.32737"
474 id="path1389"
475 inkscape:connector-curvature="0" />
476 <path
477 style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1441)"
478 d="M 105.54985,260.99774 43.832203,220.82815"
479 id="path1431"
480 inkscape:connector-curvature="0" />
481 <path
482 style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2035)"
483 d="m 46.113094,237.65771 58.397326,28.5372"
484 id="path2288"
485 inkscape:connector-curvature="0" />
486 <path
487 style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2306)"
488 d="M 106.02232,272.43152 44.60119,245.78419"
489 id="path2290"
490 inkscape:connector-curvature="0" />
491 </g>
492</svg>