unknown 3 週間 前
コミット
bae1ae25c1
1 ファイル変更19 行追加1 行削除
  1. 19 1
      python_net/asyncio_my/misc.py

+ 19 - 1
python_net/asyncio_my/misc.py

@@ -32,10 +32,28 @@ async def cpu_bound_work() -> int:
 # Так делать нет никакого смысла
 @async_timed()
 async def main():
+
+    sleep_for_three = asyncio.create_task(delay(3))
+    sleep_again = asyncio.create_task(delay(3))
+    sleep_once_more = asyncio.create_task(delay(3))
+
+    await sleep_for_three
+    await sleep_again
+    await sleep_once_more
+
+
+    """
+    task_one = asyncio.create_task(cpu_bound_work())
+    print(type(task_one))
+    result = await task_one
+    print(result)
+    """
+    
+    """
     task_one = asyncio.create_task(cpu_bound_work())
     task_two = asyncio.create_task(cpu_bound_work())
     await task_one
     await task_two
-
+    """
 
 asyncio.run(main())