Fixed timer implementation
This commit is contained in:
@ -30,9 +30,15 @@ class MyShell extends Shell
|
||||
$this->pushContext($context);
|
||||
$this->updatePrompt();
|
||||
|
||||
$this->addTimer(5000, function () {
|
||||
$t1 = $this->addTimer(5000, function () {
|
||||
echo "5 seconds\n";
|
||||
});
|
||||
$app = $this;
|
||||
$t2 = $this->addTimer(15000, function () use ($t1, $app) {
|
||||
echo "Removing timers...\n";
|
||||
$app->removeTimer($t1);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected function updatePrompt()
|
||||
|
Reference in New Issue
Block a user