Fiber Support #22
Closed
EdmondDantes
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today, the development of Fiber support has been completed.
I haven’t updated the RFC text yet, this will be done later, but here you can see a brief overview of the changes.
Concept
Fibers are considered not as a low-level primitive, but as stateful generator-like coroutines.
The following statements are true:
$fiber->start()and$fiber->resume()are blocking methods. They block the execution of the coroutine that calls them.1. Creating and Starting a Fiber in a Coroutine
Fibers are created inside coroutines and started with the
start()method:2. Suspend and Resume
Fibers can suspend their execution and pass values outward:
3. Multiple Suspend/Resume Cycles
A fiber can suspend multiple times:
4. Different coroutines can be suspended by different Fibers.
5. Fibers receive an additional getCoroutine() method, which returns the coroutine instance.
Beta Was this translation helpful? Give feedback.
All reactions