~/talk

Cooperative multitasking with generators

Talkat Dutch PHP Conference 2017 · 2017-06-29..07-01· [php, concurrency]
slides:none on file

Shows how PHP generators (added in PHP 5.5) let functions yield pauses and resumes execution so a file reader holds only one line in memory and a bubble-sort can emit intermediate steps; builds a cooperative multitasker in about 64 lines of code that runs tasks interleaved in one thread (asynchronous not parallel). Demonstrates use of amp, react PHP and recoil, and an actual site (pre-process dot IO) using generators with promises to run a non-blocking HTTP server in production.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05What about arrays
  3. 4:22Implementing iterator
  4. 10:17Implementing generators
  5. 13:51Bubble sorting
  6. 20:53Data tables
  7. 22:09Task manager
  8. 26:07Generator
  9. 30:58Recap
  10. 32:14Nonblocking code
  11. 41:52Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.