Upgrade to Pro — share decks privately, control downloads, hide ads and more …

This Person Does Not Exist — From Synchronous P...

This Person Does Not Exist — From Synchronous PHP to Asynchronous Orchestration with Flow

Présentation canonique Slidewire par Mathieu Ledru (@matyo91), Darkwood. 14 slides, 22 pages PDF avec pagination des contenus denses. Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist

Avatar for Mathieu Ledru

Mathieu Ledru

November 06, 2026

More Decks by Mathieu Ledru

Other Decks in Programming

Transcript

  1. Darkwood · PHP · Orchestration This Person Does Not Exist

    From Synchronous PHP to Asynchronous Orchestration with Flow A minimal Symfony experiment HTTP request → Image bytes → File saved @matyo91
  2. The problem Download 10 images. Respect a rate limit. Save

    each file. Image 1 Image 2 Image 3 … Image 10 Same pipeline for every image. No dependency between them. Why are we waiting? 01 | problem @matyo91
  3. Slide 3 · 1/2 · représentation statique The synchronous loop

    One image at a time. The process blocks on every step. IMAGE 1 Fetch → Save→ Sleep IMAGE 2 waits… IMAGE 3 waits… Everything waits. 02 | sync-loop Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  4. Slide 3 · 2/2 · représentation statique The synchronous loop

    One image at a time. The process blocks on every step. for (...) { fetch(); save(); sleep(); } 02 | sync-loop Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  5. Slide 4 · 1/2 · représentation statique What is actually

    happening? A hidden pipeline, repeated N times. ↓ ↓ Fetch Save Report 03 | pipeline Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  6. Slide 4 · 2/2 · représentation statique What is actually

    happening? A hidden pipeline, repeated N times. Each image is an independent work unit. 03 | pipeline Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  7. Slide 5 · 1/1 · représentation statique The hidden opportunity

    Independent units. Same pipeline. Image 1 Image 2 Pipeline Fetch → Save → Report Image 3 Why not run them together? 04 | opportunity Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  8. Introducing Flow Work units enter an orchestrator. ↓ Ip(1) Ip(2)

    Ip(3) Flow ↓ Pipeline An Ip represents one work unit - a payload traveling through the pipeline. 05 | flow @matyo91
  9. Slide 7 · 1/2 · représentation statique The pipeline Describe

    steps once. Every Ip follows the same path. ↓ ↓ Ip Fetch Image Save Image 06 | pipeline-steps Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  10. Slide 7 · 2/2 · représentation statique The pipeline ↓

    Describe steps once. Every Ip follows the same path. Report 06 | pipeline-steps Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  11. The migration Suspend the work unit - not the whole

    process. BEFORE · BLOCKING sleep(1); Entire process frozen. AFTER · COOPERATIVE $driver->delay($delay); Only this fiber suspends. Rate limiting per unit. Progress for everyone else. 07 | migration @matyo91
  12. Slide 9 · 1/1 · représentation statique Fibers · PHP

    8.1 Waiting becomes productive. Fiber A delay - suspended waiting Fiber B downloading image working Fiber C saving to disk working Fiber A resumed - fetch starts resume FiberDriver delegates execution. Flow orchestrates the pipeline. 08 | fibers Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  13. Slide 10 · 1/2 · représentation statique The new execution

    model Enqueue work. Await completion. for (...) { $flow(new Ip(...)); } $flow->await(); 09 | execution Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  14. Slide 10 · 2/2 · représentation statique The new execution

    model Enqueue work. Await completion. enqueue Ip enqueue Ip enqueue Ip Flow scheduler pipeline execution await The for loop produces work. Flow schedules it. 09 | execution Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  15. Slide 11 · 1/2 · représentation statique Clarification What Flow

    is - and is not. ✕ Event Loop ✕ Fiber implementation ✕ Runtime ✕ ReactPHP / Amp replacement ✓ Orchestration model 10 | what-flow-is Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  16. Slide 11 · 2/2 · représentation statique Clarification What Flow

    is - and is not. FiberDriver AmpDriver ReactDriver SwooleDriver Describe the pipeline once. Choose the driver for execution. 10 | what-flow-is Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  17. Slide 12 · 1/3 · représentation statique Beyond the POC

    Same orchestration model. Different domains. YouTube ↓ ↓ Scrape Transcript Publish Video Scene gen 11 | applications Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  18. Slide 12 · 2/3 · représentation statique Beyond the POC

    ↓ Same orchestration model. Different domains. ↓ Encode Persist AI Agents ↓ Read Transform 11 | applications Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  19. Slide 12 · 3/3 · représentation statique Beyond the POC

    ↓ Same orchestration model. Different domains. Act Independent units. Composable steps. One orchestrator. 11 | applications Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist @matyo91
  20. Takeaway Not about performance. About orchestration. BEFORE AFTER Execute task

    A then B then C Describe work units Describe a pipeline Let the orchestrator schedule Ip 12 | takeaway ↓ Flow ↓ Fetch ↓ Save ↓ await() @matyo91
  21. Slide 14 · 1/2 · représentation statique Resources Go deeper.

    flow-thispersondoesnotexist - POC repo · commits fae47e8 c61c929 → darkwood/flow - orchestration package · examples/flow.php Frédéric Bouchery - The Evolution of Async PHP f2r.github.io/fr/asynchrone.html @matyo91 Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist
  22. Slide 14 · 2/2 · représentation statique Resources Go deeper.

    → → Sync loop Flow pipeline Darkwood scale @matyo91 Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/flow-thispersondoesnotexist