Asyncio
Structured guidance for async Python with asyncio: confirm triggers, propose the stages below, and adapt if the user wants a lighter pass.
When to Offer This Workflow
Trigger conditions:
- - User mentions asyncio, async python, or closely related work
- They want a structured workflow rather than ad-hoc tips
- They are preparing a review, rollout, or stakeholder communication
Initial offer:
Explain the four stages briefly and ask whether to follow this workflow or work freeform. If they decline, continue in their preferred style.
Workflow Stages
Stage 1: Clarify context & goals
Anchor on event loop and tasks. Ask what success looks like, constraints, and what must not break. Capture unknowns early.
Stage 2: Design or plan the approach
Translate goals into a concrete plan around cancellation and timeouts. Compare alternatives and explicit trade-offs; avoid implicit assumptions.
Stage 3: Implement, validate, and harden
Execute with verification loops tied to backpressure and queues. Prefer small steps, measurable checks, and rollback points where risk is high.
Stage 4: Operate, communicate, and iterate
Close the loop with debugging concurrency: monitoring, documentation, stakeholder updates, and lessons learned for the next cycle.
Checklist Before Completion
- - Goals and constraints are explicit for asyncio work
- Risks and trade-offs are stated, not hand-waved
- Verification steps match the change’s impact (tests, canary, peer review)
- Operational follow-through is covered (monitoring, docs, owners)
Tips for Effective Guidance
- - Be procedural: stage-by-stage, with clear exit criteria
- Ask for missing context (environment, scale, deadlines) before prescribing
- Prefer checklists and concrete examples over generic platitudes
- If the user declines the workflow, switch to freeform help without lecturing
Handling Deviations
- - If the user wants to skip a stage: confirm and continue with what they need.
- If context is missing: ask targeted questions before strong recommendations.
- Prefer concrete examples, trade-offs, and verification steps over generic advice.
Quality Bar
- - Each recommendation should be actionable (what to do next).
- Call out failure modes relevant to asyncio concurrency (security, scale, UX, or ops).
- Keep tone direct and respectful of the user’s time.
Asyncio
针对 async Python 与 asyncio 的结构化指导:确认触发条件,提出以下阶段,并在用户希望轻量化处理时进行调整。
何时提供此工作流程
触发条件:
- - 用户提及 asyncio、async python 或密切相关的工作
- 用户希望获得结构化工作流程而非临时建议
- 用户正在准备评审、部署或利益相关方沟通
初始提议:
简要说明四个阶段,并询问是否遵循此工作流程或自由进行。如果用户拒绝,则继续以他们偏好的风格提供帮助。
工作流程阶段
阶段 1:明确背景与目标
聚焦于事件循环与任务。询问成功的标准、约束条件以及哪些内容不能出错。尽早捕获未知因素。
阶段 2:设计或规划方案
将目标转化为围绕取消与超时的具体计划。比较备选方案与明确的权衡取舍;避免隐含假设。
阶段 3:实施、验证与加固
通过关联背压与队列的验证循环来执行。优先采用小步骤、可衡量的检查,并在高风险处设置回滚点。
阶段 4:运维、沟通与迭代
通过调试并发来闭环:监控、文档、利益相关方更新以及为下一周期积累的经验教训。
完成前检查清单
- - asyncio 工作的目标与约束已明确
- 风险与权衡已陈述,而非敷衍了事
- 验证步骤与变更影响相匹配(测试、灰度、同行评审)
- 运维后续工作已覆盖(监控、文档、负责人)
有效指导技巧
- - 按流程进行:分阶段推进,并设定明确的退出标准
- 在给出建议前,先询问缺失的背景信息(环境、规模、截止日期)
- 优先使用检查清单和具体示例,而非泛泛之谈
- 如果用户拒绝工作流程,则切换为自由帮助模式,不进行说教
偏差处理
- - 如果用户希望跳过某个阶段:确认后继续提供他们所需的内容
- 如果背景信息缺失:在给出强烈建议前,先提出有针对性的问题
- 优先提供具体示例、权衡取舍和验证步骤,而非通用建议
质量标准
- - 每条建议应可操作(下一步该做什么)
- 指出与 asyncio 并发相关的故障模式(安全、规模、用户体验或运维)
- 保持语气直接,尊重用户的时间