Php Concurrency
Implement concurrency and non-blocking I/O in modern PHP. Use when implementing concurrent requests, async processing, or non-blocking I/O in PHP.
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install multi-language-standards-php-concurrencyManual setup by platform
Claude Code
~/.claude/skills/multi-language-standards-php-concurrency/SKILL.md
Instructions
PHP Concurrency
Priority: P2 (MEDIUM)
Structure
See implementation examples for directory layout.
Implement PHP Fibers (8.1+)
- Multitasking: Use
new Fiber()for low-level cooperative multitasking. - Yielding Control: Use
Fiber::suspend('paused')to yield execution back to caller. - Resuming: Call
$fiber->resume('hello')to continue execution. Catch exceptions via$fiber->getReturn(). - Isolation: Use separate PDO connections per Fiber to avoid shared mutable state.
See implementation examples for Fiber cooperative multitasking code.
Configure Non-blocking I/O & Event Loops
- Loop Setup: Use ReactPHP or Amp. Call
Loop::get()to access event loop. - HTTP Clients: Use
react/httpor GuzzlePool($client, ...)for concurrent requests. - I/O Safety: Never use blocking
file_get_contentsorsleep()inside Fiber or EventLoop. - Entry Point: Run
Loop::run()at your application entry point to start async loop.
See implementation examples for concurrent HTTP requests with Guzzle Pool.
Choose Concurrency Strategies
- Queued Jobs: For heavy concurrency, prefer Laravel Horizon or Symfony Messenger over raw PHP Fibers.
- Self-Contained Logic: Ensure Fibers manage their own state and exceptions to prevent cross-contamination.
Anti-Patterns
- No deeply nested Fiber suspends: Keep Fiber logic traceable.
- No blocking I/O inside Fibers: Use async-compatible libraries.
- No custom scheduler code: Use Amp or ReactPHP instead.
References
- Fiber Implementation Guide
Isolation checklist
- Do not share mutable connection state across Fibers; use a separate PDO connection per Fiber or enforce bounded concurrency with queued work.
Security
Reviews (0)
Related skills
Browse all →More from Multi-Language Standards
View source →More Build skills
Browse category →Frequently asked questions about php-concurrency
What does the php-concurrency skill do?
Implement concurrency and non-blocking I/O in modern PHP. Use when implementing concurrent requests, async processing, or non-blocking I/O in PHP. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the php-concurrency skill?
Run `npx @skills-hub-ai/cli install multi-language-standards-php-concurrency` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/multi-language-standards-php-concurrency/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does php-concurrency work with?
php-concurrency runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the php-concurrency skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use php-concurrency after installing it?
In Claude Code, type `/multi-language-standards-php-concurrency` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the php-concurrency skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.