Skip to content

Extend rust-development with advanced async patterns (Tower, CancellationToken, graceful shutdown) #63

@AlexMikhalev

Description

@AlexMikhalev

Parent Epic: #62

What

Add advanced async programming patterns to rust-development SKILL.md that are currently missing:

Sections to Add

  1. Graceful Shutdown -- CancellationToken pattern with tokio, signal handling
  2. Backpressure -- Bounded channels, vectored I/O batching
  3. Tower Middleware Composition -- Service trait, Layer stacking, rate limiting, concurrency control, load shedding
  4. Custom Futures -- Retry logic with exponential backoff as a Future implementation
  5. Structured Concurrency -- Task lifecycle management, JoinSet patterns

Source Reference

Sections 3 (Async Programming with Tokio 1.44+) and 9 (Advanced Async Patterns) from RUST_SYSTEM_PROGRAMMING_BEST_PRACTICES.md

Disciplined Engineering Alignment

These patterns integrate with the disciplined-* skill phases as follows:

Phase Skill Rust Async Relevance
Research disciplined-research Identify async boundaries, cancellation requirements, backpressure needs in system under analysis
Design disciplined-design Specify Tower middleware stack, shutdown strategy, channel bounds in design doc
Implementation disciplined-implementation Apply CancellationToken/JoinSet patterns; each middleware layer = one reviewable step
Verification disciplined-verification Unit test cancellation paths, verify backpressure under load, test middleware ordering
Validation disciplined-validation Validate graceful shutdown behaviour in production-like environment; UAT for timeout/retry UX

The SKILL.md should include a "Disciplined Workflow Integration" subsection noting:

  • During research: document async boundaries and failure modes
  • During design: specify Tower layer stack and channel capacities
  • During verification: test cancellation safety and backpressure behaviour

Acceptance Criteria

  • SKILL.md updated with new async section(s) including code examples
  • Existing async patterns section preserved (extend, don't replace)
  • Crate recommendations table updated (tower, tower-http)
  • Disciplined workflow integration notes included

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions