Unlock Parallel Processing in PHP with Fibers
summary
Concrete rundown of what fibers actually do: fibers arrive in PHP 8.1 as a Fiber class with suspend/resume and state methods, example code shows start returning the suspend value and resume supplying the next value, demos iterate an array and nest fibers (it works). Important limits: fibers pause the whole stack and currently allow only one fiber running at a time, they do not make PHP async by themselves and require a scheduler/library (examples and code link on GitHub).
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:30About Tomasz
- 1:54What are Fibers
- 3:36Methods
- 4:50Concurrent Execution
- 6:40Callable Functioning
- 9:12Asynchronous PHP
- 11:25Direct Threads
- 13:00Generators
- 13:47QR Code
- 14:45Editor
- 15:25First example
- 23:22Wrap up
- 25:02Questions
- 27:30Isrunning
- 29:00Sequential execution
- 31:01Database connection
- 32:02Recap
- 33:18Unit test
- 34:09Audience questions
related talks
51mPHP Fibers
01h 00mHow do Fibers Work? A Peek Under the Hood
25mAsync PHP with Coroutines: Building Scalable Applications
40mFiber in the 10th year
42mHow to write synchronization mechanisms for Fiber
01h 01mWhat's new in PHP 8.1
20mSubprocesses, Threads and Fibers
48mCooperative multitasking with generators
