Asyncio Fire And Forget Loop Exit Await

Use when writing or reviewing Python code that uses `asyncio.run(...)` as entry-point AND inside the entry-coroutine uses `asyncio.create_task(...)` for fire-and-forget background work (notifications, telemetry, advisor-calls, fan-out HTTP/DB-writes). Without an explicit `await asyncio.gather(*pending_tasks)` before the entry-coroutine returns, `asyncio.run()` closes the event-loop and CANCELS still-pending tasks — silent data-loss of 0-50% of background work. Trigger on phrases like "asyncio.run + create_task", "fire-and-forget cancelled at loop-exit", "telemetry silent dropping", "Loop closed before task finished". Do NOT load for asyncio.Runner / gather-as-entry patterns, long-running daemons (uvicorn, asyncio.Event.wait), sync code with threading.Thread, or non-Python async (JS/Go).

Ed3Design Updated

File contents

Ed3Design/ed3design-skill-bundles/tree/main/async-forensik/skills/asyncio-fire-and-forget-loop-exit-await commit 543f3bcad4

Frequently asked questions

npx skillmds@latest add ed3design/asyncio-fire-and-forget-loop-exit-await