跳到正文
cccskills
免费在 GitHub 公开

python-async

Async Python patterns via asyncio and aiohttp for I/O-bound concurrency. Use when adding async APIs, handling concurrent I/O, or debugging async code.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(8)

  • SKILL.md2.7 KB
  • modules/advanced-patterns.md2.7 KB
  • modules/basic-patterns.md1.9 KB
  • modules/concurrency-control.md2.3 KB
  • modules/error-handling-timeouts.md2.1 KB
  • modules/pitfalls-best-practices.md2.2 KB
  • modules/real-world-applications.md1.9 KB
  • modules/testing-async.md1.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Async Python Patterns

asyncio and async/await patterns for Python applications.

Quick Start

import asyncio

async def main():
    print("Hello")
    await asyncio.sleep(1)
    print("World")

asyncio.run(main())

When To Use

  • Building async web APIs (FastAPI, aiohttp)
  • Implementing concurrent I/O operations
  • Creating web scrapers with concurrent requests
  • Developing real-time applications (WebSockets)
  • Processing multiple independent tasks simultaneously
  • Building microservices with async communication

When NOT To Use

  • CPU-bound optimization - use python-performance instead
  • Testing async code - use python-testing async module

Modules

This skill uses progressive loading. Content is organized into focused modules:

  • See modules/basic-patterns.md - Core async/await, gather(), and task management
  • See modules/concurrency-control.md - Semaphores and locks for rate limiting
  • See modules/error-handling-timeouts.md - Error handling, timeouts, and cancellation
  • See modules/advanced-patterns.md - Context managers, iterators, producer-consumer
  • See modules/testing-async.md - Testing with pytest-asyncio
  • See modules/real-world-applications.md - Web scraping and database operations
  • See modules/pitfalls-best-practices.md - Common mistakes and best practices

Load specific modules based on your needs, or reference all for detailed guidance.

Exit Criteria

  • Async patterns applied correctly
  • No blocking operations in async code
  • Proper error handling implemented
  • Rate limiting configured where needed
  • Tests pass with pytest-asyncio

Troubleshooting

Common Issues

RuntimeError: no current event loop Use asyncio.run() as the entry point. Avoid get_event_loop() in Python 3.10+.

Blocking call in async context Move sync I/O to asyncio.to_thread() or loop.run_in_executor().

Tests hang indefinitely Ensure pytest-asyncio is installed and test functions are decorated with @pytest.mark.asyncio.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Shapes turns action-first: action leads, steps numbered, state restated. Use for ADHD-friendly output. Do not use to trim tokens; use response-compression.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

Inverts burden of proof for code additions. Use when reviewing PRs, planning refactors, or running unbloat to challenge every addition's necessity.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

Tracks per-agent token usage and flags waste in parallel dispatch. Use when evaluating parallel agent efficiency or after a multi-agent run.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

Coordinates Claude agent teams via filesystem protocol. Use when orchestrating parallel agents with task dependencies. Do not use for single-agent tasks.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

Evaluates API surface design, consistency, and exemplar alignment. Use when reviewing public API changes or before releasing a new API surface.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

Selects architecture paradigm via research before scaffolding. Use when architecture is undecided and the choice needs justification and documentation.

中文简介正在准备中。当前显示原文说明。

athola/claude-night-market3422026年10月17日 更新

查看 athola 的全部技能

报告此技能的问题