Event::wait

函数原型:

void Event::wait(void);

启动事件监听,请将此函数放置于PHP程序末尾。

使用实例

Swoole\Timer::tick(1000, function () {
    echo "hello\n";
});

Swoole\Event::wait();


  • xujiandev

    hi, centOS 6.5 + php5.3.20, 测试用例就是github上最简单的那个server和client 在client最后一行加上 swoole_event_wait(); 依然会报 [19-Sep-2014 22:52:59 Asia/Shanghai] PHP Warning: swoole_client::connect(): swoole_client: PHP5.3 not support auto run swoole_event_wait. Please append swoole_event_wait at the script end. in /home/work/sandc/client.php on line 21