queues Supercharge Laravel Queues with Hypervel Breaking I/O bottlenecks in the AI era PRESENTED BY Albert Chen file talk.php runtime swoole + coroutine target queue:work --concurrency=1000
— or minutes. AI WORKLOADS Chatbot completion Image generation Voice / TTS synthesis Video processing & agent flows 3s → 30s → 3min Even at low QPS, the queue outruns the workers. INCOMING ▶ QUEUE ▶ WORKER W PER-JOB ~30 s PROCESSED 0 QUEUE BACKLOGS ↑ growing 05 / 22 · AI ERA jobs minutes long · backlog grows
workers do you need? PER-JOB DURATION WORKERS REQUIRED WORKLOAD EXAMPLE 0.5 s 50 Email / SMS 1 s 100 Threshold 5 s 500 Light AI call 10 s 1,000 Typical LLM inference 30 s 3,000 Complex reasoning / image gen 60 s 6,000 Video / agentic flow ※ Little's Law: Required Processes = QPS × I/O Time. 06 / 22 · THE MATH 100 qps · workers number
Based on Hyperf Fully ported from Laravel Laravel API ~90% similar Near 1:1 parity Ported packages All core components · + Horizon, Scout, Socialite, Sanctum, Telescope All of 0.3 · + Ignition, Inertia, Reverb, Boost, Laravel AI (planning) Release status Current Beta coming soon 08 / 22 · ROADMAP 0.3 → 0.4
Laravel wasn't built for coroutines — state bleeds across them. CODE CATEGORY USE AS-IS? WHAT TO DO Laravel ecosystem packages Auth, Log, Eloquent, Redis, Cache, Http, etc. ✕ no Swap for Hypervel's ports — API is near-identical. Native PHP I/O file_get_contents, fopen, fsockopen, sleep, etc. ✓ yes Auto-coroutinized by Swoole's runtime hook. cURL-based libraries native curl, Guzzle, most of 3rd-party SDKs, etc. ✓ yes Works unchanged (assuming no global-state abuse). 10 / 22 · CONSTRAINTS state bleeding · swap your packages
01 Create a listener implementing ShouldQueue . 02 Leave handle() empty — real work runs in Hypervel. 03 Set public $queue = 'hypervel' . 04 Wire the event→listener mapping as usual. namespace App\Listeners; use App\Events\UserRegistered; use Illuminate\Contracts\Queue\ShouldQueue; class SendWelcomeEmail implements ShouldQueue { public $queue = 'hypervel'; // ← routed to Hypervel public function handle(UserRegistered $event): void { // Intentionally empty. // The Hypervel worker owns the real implementation. } } app/Listeners/SendWelcomeEmail.php 12 / 22 · LARAVEL SIDE shim listener · ~12 lines
swap Illuminate→Hypervel. Same Http facade. Same Eloquent query. Same code shape. Different runtime. Laravel BLOCKING → Hypervel NON-BLOCKING · COROUTINE DIFF One line. Illuminate → Hypervel. Http facade + Eloquent query are byte-for-byte identical — and now they yield on I/O. namespace App\Listeners; use Illuminate \Support\Facades\Http; use App\Models\User; class SyncUserProfile { public function handle(UserRegistered $event): void { $response = Http::timeout(10) ->get('https://api.crm.io/users/'.$event->id); User::where('id', $event->id) ->update(['profile' => $response->json()]); } } app/Listeners/SyncUserProfile.php R E P L A C E N A M E S P A C E namespace App\Listeners; use Hypervel \Support\Facades\Http; use App\Models\User; class SyncUserProfile { public function handle(UserRegistered $event): void { $response = Http::timeout(10) ->get('https://api.crm.io/users/'.$event->id); User::where('id', $event->id) ->update(['profile' => $response->json()]); } } app/Listeners/SyncUserProfile.php 13 / 22 · THE TRICK illuminate ⇢ hypervel · 1 line
a time. t = 0.0s … 996 more, one after another … PROCESSES 1 IN FLIGHT 1 TIME TO DRAIN ~5,000 s Laravel's worker can only process one job at a time due to the limit of blocking I/O in PHP. job #1 · sleep(5) job #2 · sleep(5) job #3 · sleep(5) job #4 · sleep(5) 15 / 22 · LARAVEL WORKER serial · blocking
Same count. Three orders of magnitude. METRIC LARAVEL (1 WORKER) HYPERVEL (1 WORKER · C=1000) Processes 1 1 Jobs in flight 1 1,000 Total duration ~5,000 s ~5 s Workers for equivalent throughput 1,000 — Memory / CPU footprint Linear in worker count Flat · one process 18 / 22 · HEAD TO HEAD 1000× throughput · 1/1000 cost
traditional queue model breaks in the AI era. Multi-second jobs don't fit into 1-process-per-worker economics. 02 Offload your I/O-heavy jobs to Hypervel's queue worker. The API is Laravel's. The runtime is Swoole's. The DX is already familiar. 03 You don't rewrite anything — you add a lane. Open one hypervel queue. Laravel and Hypervel share Redis. Ship tomorrow. Laravel + Hypervel = Better together. 21 / 22 · TAKEAWAYS ship tomorrow