async-patterns

Installation
SKILL.md

Async Patterns

Rules Summary

  1. Prefer safe_gather for all new async code - it provides fail-fast, timeout support, and cleaner cancellation
  2. Use safe_gather with return_exceptions=True for partial-results patterns (better than asyncio.gather due to timeout support)
  3. Migrating existing cleanup/shutdown code to safe_gather is optional (low priority, both work fine)
  4. Only use asyncio.wait with FIRST_COMPLETED for incremental processing patterns
  5. Always consider timeout and cancellation behavior when choosing async primitives

safe_gather vs asyncio.gather

Default Choice: safe_gather

safe_gather is better than asyncio.gather in ALL cases because it provides:

  • Fail-fast cancellation (when not using return_exceptions=True)
  • Timeout support with automatic cleanup
Related skills

More from gigaverse-app/skillet

Installs
3
GitHub Stars
3
First Seen
Jan 21, 2026