Skip to content

Commit b6064cb

Browse files
author
niulingyun
committed
change to goSleep
1 parent a2eb39a commit b6064cb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Coroutine/Sleep.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class Sleep extends Base
1717
public $__sleepTime;
1818

1919
/**
20-
* @param int $sleepTime 时间,单位为毫秒
20+
* @param int $mSec 时间,单位为毫秒
21+
* @return $this
2122
*/
22-
public function __construct($sleepTime)
23+
public function goSleep(int $mSec)
2324
{
24-
$this->__sleepTime = $sleepTime;
25-
parent::__construct(0);
25+
$this->__sleepTime = $mSec;
2626
$this->requestId = $this->getContext()->getLogId();
2727

2828
getInstance()->scheduler->IOCallBack[$this->requestId][] = $this;
@@ -38,6 +38,7 @@ public function __construct($sleepTime)
3838
$this->ioBack = true;
3939
$this->nextRun();
4040
});
41+
return $this;
4142
}
4243

4344
/**

0 commit comments

Comments
 (0)