Darkwood Β· PHP Β· Orchestration
A minimal Symfony experiment
The problem
Same pipeline for every image. No dependency between them.
Why are we waiting?
The synchronous loop
Everything waits.
for (...) { fetch(); save(); sleep(); }
What is actually happening?
Each image is an independent work unit.
The hidden opportunity
flowchart LR I1[Image 1] I2[Image 2] I3[Image 3] P[Pipeline\nFetch β Save β Report] I1 --> P I2 --> P I3 --> P
Why not run them together?
Introducing Flow
An Ip represents one work unit - a payload traveling through the pipeline.
The pipeline
The migration
sleep(1);
Entire process frozen.
$driver->delay($delay);
Only this fiber suspends.
Rate limiting per unit. Progress for everyone else.
Fibers Β· PHP 8.1
FiberDriver delegates execution. Flow orchestrates the pipeline.
The new execution model
for (...) {
$flow(new Ip(...));
}
$flow->await();
flowchart TB E1[enqueue Ip] E2[enqueue Ip] E3[enqueue Ip] S[Flow scheduler] P[pipeline execution] A[await] E1 --> S E2 --> S E3 --> S S --> P P --> A
The for loop produces work. Flow schedules it.
Clarification
Describe the pipeline once. Choose the driver for execution.
Beyond the POC
Independent units. Composable steps. One orchestrator.
Takeaway
Execute task A
then B
then C
Resources
flow-thispersondoesnotexist - POC repo Β· commits fae47e8 β c61c929darkwood/flow - orchestration package Β· examples/flow.php