/**
* NewEventLoopScheduler constructor.
* @param callable|LoopInterface $timerCallableOrLoop
*/
public function __construct($timerCallableOrLoop)
{
// passing a loop directly into the scheduler will be deprecated in the next major release
$this->timerCallable = $timerCallableOrLoop instanceof LoopInterface ? function ($ms, $callable) use($timerCallableOrLoop) {
$timerCallableOrLoop->addTimer($ms / 1000, $callable);
} : $timerCallableOrLoop;
parent::__construct($this->now(), function ($a, $b) {
return $a - $b;
});
}