Cooperative Multitasking framework in PHP