Hacker News new | ask | show | jobs
by barrkel 5722 days ago
Async I/O is important for any time the connection needs to be kept open while processing the request under heavily concurrent conditions; it's less about not blocking on I/O, than it is about avoiding the overhead of context switching in the kernel and the extra resources of keeping a thread / process alive for the duration of the request. I don't see it as less or more important in a PHP context than an event-based model. However, without an automatic CPS transformation (continuation passing style) of the source of your request handling logic - in particular, continuations at the boundary points all I/Os - you do need to write to a pattern which is in effect event-driven.