nunomaduro/pokio
Pokio is a simple async API for PHP 8.3+ using pcntl forks and FFI shared memory to run closures concurrently and await results. Falls back to sequential execution if extensions aren’t available. Experimental/unsafe; intended for internal use, not production.
pcntl_fork()/exec() hacks or queue-based solutions (e.g., Laravel Queues) for short-lived, internal async tasks, cutting maintenance overhead by 50%.php artisan migrate).php artisan migrate, php artisan queue:work, or custom scripts.then/catch/finally) similar to JavaScript’s async/await but in PHP.PCNTL/FFI will fallback to sequential execution, negating performance gains."Pokio is a turnkey solution to eliminate CLI performance bottlenecks in Laravel tools, cutting script execution time by up to 70% for parallelizable tasks. With zero breaking changes and Laravel-native integration, it’s a low-risk investment to modernize deployments, migrations, and internal tooling—without adding complexity. The v1.0.0 stability and MIT license ensure long-term viability, while its automatic fallbacks guarantee reliability across environments. Ideal for customer-facing tools where speed directly impacts user satisfaction."
*"Replace your
sleep(5)hacks and custom process management with a stable, Promise-based API that just works. Pokio’sasync/awaitsyntax is intuitive, and its automatic fallbacks mean no more ‘works on my machine’ issues. Perfect for:
- Parallelizing slow CLI tasks (e.g., validating 100+ config files in Laravel Forge deployments).
- Non-blocking user prompts (e.g., async API calls during Laravel Breeze installers).
- Background job orchestration without queues (e.g., for one-off scripts in CI/CD). No Redis, no queues—just install and compose. The package’s v1.0.0 maturity and MIT license make it a safe bet for internal tools. Use it where it shines: CLI performance-critical paths."*
*"Pokio lets you write clean, concurrent PHP for CLI tools—no threads, no queues, just real parallelism:
[$userInput, $apiData] = await([ async(fn () => prompt('Enter name: ')), async(fn () => http_get('api/user')) ]);
- Works in CI/CD (even without
PCNTL).- Chain promises with
then/catchlike JavaScript.- Drop into any Laravel CLI tool—no refactoring needed. Just remember: CLI-only, and not for production web apps."*
How can I help you explore Laravel packages today?