This repository has been archived on 2023-05-12. You can view files and clone it, but cannot push or open issues or pull requests.
2022-10-18 17:26:58 +02:00
|
|
|
import aiosched
|
2022-10-19 12:02:40 +02:00
|
|
|
from raw_wait import child
|
2022-10-18 17:26:58 +02:00
|
|
|
from debugger import Debugger
|
|
|
|
|
|
|
|
|
|
|
|
async def main(children: list[tuple[str, int]]):
|
|
|
|
print("[main] Spawning children")
|
|
|
|
async with aiosched.with_context() as ctx:
|
|
|
|
for name, delay in children:
|
|
|
|
await ctx.spawn(child, name, delay)
|
2022-10-19 11:31:45 +02:00
|
|
|
print("[main] Children spawned")
|
2022-10-18 17:26:58 +02:00
|
|
|
before = aiosched.clock()
|
|
|
|
print(f"[main] Children exited in {aiosched.clock() - before:.2f} seconds")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-11-02 09:28:04 +01:00
|
|
|
aiosched.run(main, [("first", 1), ("second", 2), ("third", 3)], debugger=None)
|