Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Octane Coroutine

Octane Coroutine Laravel Package

modelslab/octane-coroutine

Adds coroutine support to Laravel Octane, letting you run concurrent PHP tasks inside Octane workers for faster I/O-bound requests. Integrates with Swoole coroutines, offers simple helpers for parallel execution, and helps reduce response times without changing your application structure.

View on GitHub
Deep Wiki
Context7

Laravel Octane with Swoole Coroutine Support

Frequently asked questions about Octane Coroutine
What is modelslab/octane-coroutine used for?
It adds coroutine-based concurrency to Laravel Octane so you can run multiple tasks inside an Octane worker without blocking the request lifecycle. It is intended for I/O-heavy workloads where parallel execution can reduce latency, and it integrates with Swoole coroutine environments. The package provides lightweight helpers for parallel I/O and a Laravel-friendly setup rather than changing your application structure.
How do I install modelslab/octane-coroutine?
Install it with Composer and ensure your application is running Laravel Octane on a Swoole coroutine environment. Choose a version constraint carefully: constraints such as ^0.8, ~0.8.36, or * can resolve to the mis-indexed 0.8.36 release, which points at pre-fix code. Pin to 0.8.37 or a constraint that explicitly excludes 0.8.36, then follow the package README for any Octane configuration.
Which Laravel and PHP versions are supported by modelslab/octane-coroutine?
The documented verification matrix is PHP 8.3 and 8.4 with Laravel 11, 12, and 13. If you run PHP 8.2 or Laravel 10, you are outside the verified envelope and should test carefully before relying on it. Check the repository for the current support matrix before upgrading.
Does modelslab/octane-coroutine require Swoole?
Yes, it is built for Swoole coroutine environments and integrates with Laravel Octane workers running under Swoole. It is not described as a general-purpose async layer for non-Swoole runtimes. If your Octane setup uses RoadRunner or another server, this package is not the right fit.
How do I run multiple I/O tasks concurrently in Laravel Octane with this package?
Use the package's coroutine helpers to execute tasks concurrently inside an Octane worker instead of running them sequentially. This is most useful for parallel I/O such as multiple HTTP calls or database lookups where waiting dominates response time. Keep request-scoped state in mind and verify behavior under an actual Swoole worker rather than only in a traditional PHP-FPM test.
Is modelslab/octane-coroutine safe for production?
Version 0.8.37 contains correctness fixes for request state escaping its request and for duplicate after-response job execution, so production use should be on 0.8.37 or later. The release notes describe fixes for callback accumulation, session guard reading the boot request, and terminate callbacks re-running prior requests. Production evidence cited is a single Swoole plus nginx image, so validate against your own traffic shape. Review the opt-in Redis pool settings before enabling them under load.
Why should I avoid modelslab/octane-coroutine 0.8.36?
Version 0.8.37 is byte-identical to 0.8.36 and exists because Packagist indexed 0.8.36 while its tag briefly pointed at the 0.8.35 commit. Packagist still serves that mapping, so a Composer update resolving to 0.8.36 can install pre-fix code. Any constraint that permits 0.8.36, including ^0.8, ~0.8.36, and *, is unsafe if you need the fixes.
What is octane.swoole.redis_pool in modelslab/octane-coroutine?
It is an opt-in Redis connection pool setting that is default-off, so it can be adopted separately from the correctness fixes. The pool introduces a new failure surface: a lease held past its request throws rather than sharing the socket, and sockets are returned only when provably clean. Review defaults such as max_idle 16, max_idle_time 60 seconds, ping_after_idle 5 seconds, and max_lifetime 300 seconds against your traffic.
Does modelslab/octane-coroutine fix duplicate after-response jobs?
Yes, the 0.8.37 release fixes an afterResponse() defect where a single dispatch plus 40 requests produced 41 executions. After-response jobs should now run once, which matters for email, webhooks, billing, and other side effects. Treat this as a correctness and data-integrity fix rather than a performance tweak, and remove any deduplication that existed only to tolerate the duplicate executions.
What are alternatives to modelslab/octane-coroutine for concurrency in Laravel?
Alternatives include Laravel Octane's own concurrency facilities, writing Swoole coroutine code directly, or using async libraries such as Amp or ReactPHP where they fit your architecture. The trade-off is usually integration depth versus control: native Octane helpers keep you inside the framework, while lower-level coroutine or async code requires more careful request-state handling. Evaluate maintenance activity and verified Laravel and PHP version support before choosing.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo