fiber について調べてて、そういえば PHP には tick とかいうのがあったなあと思い、頭に浮かんでから 30 分ほどでできたのがこれ。きれいに書けてないのは Net_DNS が汚いからと、PHP の select() の API のせいです。そうそう、Net_DNS が必要です。 <?php require_once 'Net/DNS.php'; class AsyncIOHandler { const READ = 1; const WRITE = 2; private $hdlrs = array(); private $readees = array(); private $writees = array(); private $in_crit_section = false; function add($sock, $event, $hdlr, $timeout) { i