> php-concurrency

Handling concurrency and non-blocking I/O in modern PHP. Use when implementing concurrent requests, async processing, or non-blocking I/O in PHP. (triggers: **/*.php, Fiber, suspend, resume, non-blocking, async)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/php-concurrency?format=md"
SKILL.mdphp-concurrency

PHP Concurrency

Priority: P2 (MEDIUM)

Structure

src/
└── Async/
    ├── Schedulers/
    └── Clients/

Implementation Guidelines

  • Fibers: Use Fiber for low-level cooperative multitasking (8.1+).
  • Yield Control: Apply Fiber::suspend() to yield within Fibers.
  • I/O Bound: Target I/O tasks only; avoid for CPU intensive work.
  • Frameworks: Prefer Amp or ReactPHP for complex events.
  • Self-Contained: Ensure Fibers manage their own state/exceptions.
  • Incremental: Refactor single bottlenecks before full async.

Anti-Patterns

  • Implicit Flows: No Deep Suspend: Keep Fiber logic traceable.
  • Internal Blocking: No Blocking I/O: Don't block inside Fibers.
  • Custom Schedulers: No DIY Schedulers: Use proven async libs.

References

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────