PH

php-concurrency

Guidance for using PHP Fibers and asynchronous programming for concurrent execution.

Install

mkdir -p .claude/skills/php-concurrency && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10796" && unzip -o skill.zip -d .claude/skills/php-concurrency && rm skill.zip

Installs to .claude/skills/php-concurrency

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Implement 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)
212 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Implement Fiber multitasking
  • Set up non-blocking I/O
  • Handle concurrent API requests

How it works

It uses PHP Fibers for cooperative multitasking and event loops for non-blocking I/O.

Inputs & outputs

You give it
Concurrency requirements
You get back
Async PHP implementation

When to use php-concurrency

  • Implement Fiber multitasking
  • Set up non-blocking I/O
  • Handle concurrent API requests

About this skill

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 the 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 the event loop.
  • HTTP Clients: Use react/http or the Guzzle Pool($client, ...) for concurrent requests.
  • I/O Safety: Never use blocking file_get_contents or sleep() inside a Fiber or EventLoop.
  • Entry Point: Run Loop::run() at your application entry point to start the 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

When not to use it

  • Blocking I/O
  • Custom scheduler code

Prerequisites

PHP 8.1+

Limitations

  • Requires async-compatible libraries

How it compares

It enables async patterns in PHP rather than relying on synchronous blocking code.

Compared to similar skills

php-concurrency side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
php-concurrency (this skill)04moNo flagsAdvanced
pulse-development03moReviewIntermediate
wordpress02moNo flagsAdvanced
wordpress-pro02moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

pulse-development

THM-Health

Handles Laravel Pulse setup, configuration, and custom card development. Activates when installing Pulse; configuring the dashboard or authorization gate; setting up recorders and filtering; building custom Livewire cards; optimizing with Redis ingest or sampling; or when the user mentions /pulse, p

00

wordpress

FISCFED9

Complete WordPress development workflow covering theme development, plugin creation, WooCommerce integration, performance optimization, and security hardening. Includes WordPress 7.0 features: Real-Time Collaboration, AI Connectors, Abilities API, DataViews, and PHP-only blocks.

00

wordpress-pro

trongquach

Develops custom WordPress themes and plugins, creates and registers Gutenberg blocks and block patterns, configures WooCommerce stores, implements WordPress REST API endpoints, applies security hardening (nonces, sanitization, escaping, capability checks), and optimizes performance through caching a

00

woocommerce-code-review

woocommerce

Review WooCommerce code changes for coding standards compliance. Use when reviewing code locally, performing automated PR reviews, or checking code quality.

647

laravel-pdf

spatie

Generate PDFs from Blade views or HTML using spatie/laravel-pdf. Covers creating, formatting, saving, downloading, and testing PDFs with the Browsershot, Cloudflare, or DOMPDF driver.

1140

woocommerce-backend-dev

woocommerce

Add or modify WooCommerce backend PHP code following project conventions. Use when creating new classes, methods, hooks, or modifying existing backend code. **MUST be invoked before writing any PHP unit tests.**

724

Search skills

Search the agent skills registry