์Šคํ‚ฌ async-python-patterns
โšก

async-python-patterns

์•ˆ์ „ ๐ŸŒ ๋„คํŠธ์›Œํฌ ์ ‘๊ทผโš™๏ธ ์™ธ๋ถ€ ๋ช…๋ น์–ด

Master Async Python Patterns

๋˜ํ•œ ๋‹ค์Œ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ActiveInferenceInstitute

Build high-performance Python applications with async/await patterns. Learn concurrent programming techniques for scalable I/O-bound systems.

์ง€์›: Claude Codex Code(CC)
๐Ÿ“Š 69 ์ ์ ˆํ•จ
1

์Šคํ‚ฌ ZIP ๋‹ค์šด๋กœ๋“œ

2

Claude์—์„œ ์—…๋กœ๋“œ

์„ค์ • โ†’ ๊ธฐ๋Šฅ โ†’ ์Šคํ‚ฌ โ†’ ์Šคํ‚ฌ ์—…๋กœ๋“œ๋กœ ์ด๋™

3

ํ† ๊ธ€์„ ์ผœ๊ณ  ์‚ฌ์šฉ ์‹œ์ž‘

ํ…Œ์ŠคํŠธํ•ด ๋ณด๊ธฐ

"async-python-patterns" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Show me how to fetch multiple URLs concurrently with timeout handling

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Use asyncio.gather() with asyncio.wait_for() for timeout control
  • Create aiohttp ClientSession with connection pooling
  • Handle both successful responses and timeouts gracefully
  • Return results with status codes and error information

"async-python-patterns" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. How do I implement a rate limiter for API calls

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Use asyncio.Semaphore to limit concurrent requests
  • Apply semaphore with async context manager pattern
  • Set appropriate max_concurrent value based on API limits
  • Combine with retry logic for robustness

"async-python-patterns" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. What are common mistakes when writing async Python code

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

  • Forgetting to await coroutines - they return coroutine objects, not results
  • Using time.sleep() instead of asyncio.sleep() - blocks the event loop
  • Not handling task cancellation with try/except CancelledError
  • Mixing sync and async code without proper wrapping

๋ณด์•ˆ ๊ฐ์‚ฌ

์•ˆ์ „
v4 โ€ข 1/17/2026

Documentation-only skill containing Python async programming patterns. Static analyzer flagged 77 findings, all confirmed as false positives. Markdown code fences were misidentified as shell backticks. Documentation text was misidentified as cryptographic algorithms. Example URLs are standard placeholders. No executable code, network access, or security risks exist.

2
์Šค์บ”๋œ ํŒŒ์ผ
869
๋ถ„์„๋œ ์ค„ ์ˆ˜
2
๋ฐœ๊ฒฌ ์‚ฌํ•ญ
4
์ด ๊ฐ์‚ฌ ์ˆ˜

ํ’ˆ์งˆ ์ ์ˆ˜

38
์•„ํ‚คํ…์ฒ˜
100
์œ ์ง€๋ณด์ˆ˜์„ฑ
85
์ฝ˜ํ…์ธ 
20
์ปค๋ฎค๋‹ˆํ‹ฐ
100
๋ณด์•ˆ
87
์‚ฌ์–‘ ์ค€์ˆ˜

๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ฒƒ

Build Async Web APIs

Create FastAPI and aiohttp applications with proper async patterns for handling concurrent requests

Concurrent Data Processing

Implement parallel I/O operations for database queries, file processing, and API calls

Async Automation Scripts

Write efficient automation tools that handle multiple network operations concurrently

์ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉํ•ด ๋ณด์„ธ์š”

Basic Async Pattern
Show me how to create a simple async function that fetches data with asyncio.sleep() to simulate network delay
Concurrent Requests
Demonstrate how to make 10 HTTP requests concurrently using asyncio.gather() with proper error handling
Producer-Consumer Queue
Create a producer-consumer pattern using asyncio.Queue for processing 100 items with 5 workers
WebSocket Server
Design an async WebSocket server that handles multiple clients and broadcasts messages to all connected users

๋ชจ๋ฒ” ์‚ฌ๋ก€

  • Always use asyncio.run() as the entry point for async applications
  • Implement proper error handling with try/except blocks in async functions
  • Use connection pools and semaphores to limit concurrent operations

ํ”ผํ•˜๊ธฐ

  • Never use time.sleep() in async code - always use asyncio.sleep()
  • Do not forget to await coroutines or they will not execute
  • Avoid mixing blocking I/O operations with async code

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

Which Python versions support asyncio?
Python 3.4+ has asyncio, but Python 3.7+ is recommended for async/await syntax and asyncio.run()
When should I use async versus threads?
Use async for I/O-bound operations, threads for CPU-bound tasks that block the event loop
Can I use async with Django?
Django 3.0+ supports async views, but use Django 4.1+ for full async ORM support
How do I debug async code?
Use asyncio debug mode, proper logging, and tools like aiomonitor for production debugging
What is the difference between create_task and gather?
create_task() schedules a single coroutine, gather() runs multiple coroutines concurrently and waits for all
Is this skill compatible with Jupyter notebooks?
Yes, but use asyncio.run() carefully in notebooks - consider using nest_asyncio for nested event loops

๊ฐœ๋ฐœ์ž ์„ธ๋ถ€ ์ •๋ณด

์ž‘์„ฑ์ž

wshobson

๋ผ์ด์„ ์Šค

MIT

์ฐธ์กฐ

main

ํŒŒ์ผ ๊ตฌ์กฐ

๐Ÿ“„ SKILL.md