mirror of
https://github.com/openvk/chandler.git
synced 2025-01-22 15:24:15 +03:00
Add time parameter to listen function
This commit is contained in:
parent
e3706234e7
commit
b4e1798992
1 changed files with 2 additions and 2 deletions
|
@ -64,10 +64,10 @@ class SignalManager
|
||||||
* @uses \Chandler\Signaling\SignalManager::eventFor
|
* @uses \Chandler\Signaling\SignalManager::eventFor
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function listen(\Closure $callback, int $for): void
|
function listen(\Closure $callback, int $for, int $time = 25): void
|
||||||
{
|
{
|
||||||
$this->since = time() - 1;
|
$this->since = time() - 1;
|
||||||
for($i = 0; $i < 25; $i++) {
|
for($i = 0; $i < $time; $i++) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
$event = $this->eventFor($for);
|
$event = $this->eventFor($for);
|
||||||
|
|
Loading…
Reference in a new issue