|
@@ -90,7 +90,7 @@ class Select implements EventInterface
|
|
|
* 添加事件及处理函数
|
|
* 添加事件及处理函数
|
|
|
* @see Events\EventInterface::add()
|
|
* @see Events\EventInterface::add()
|
|
|
*/
|
|
*/
|
|
|
- public function add($fd, $flag, $func, $args = null)
|
|
|
|
|
|
|
+ public function add($fd, $flag, $func, $args = array())
|
|
|
{
|
|
{
|
|
|
switch ($flag)
|
|
switch ($flag)
|
|
|
{
|
|
{
|
|
@@ -114,7 +114,7 @@ class Select implements EventInterface
|
|
|
// $fd 为 定时的时间间隔,单位为秒,支持小数,能精确到0.001秒
|
|
// $fd 为 定时的时间间隔,单位为秒,支持小数,能精确到0.001秒
|
|
|
$run_time = microtime(true)+$fd;
|
|
$run_time = microtime(true)+$fd;
|
|
|
$this->_scheduler->insert($this->_timerId, -$run_time);
|
|
$this->_scheduler->insert($this->_timerId, -$run_time);
|
|
|
- $this->_task[$this->_timerId] = array($func, $args, $flag, $fd);
|
|
|
|
|
|
|
+ $this->_task[$this->_timerId] = array($func, (array)$args, $flag, $fd);
|
|
|
$this->tick();
|
|
$this->tick();
|
|
|
return $this->_timerId++;
|
|
return $this->_timerId++;
|
|
|
}
|
|
}
|