diff --git a/lib/LibeventReactor.php b/lib/LibeventReactor.php index 9956753..ffbb607 100644 --- a/lib/LibeventReactor.php +++ b/lib/LibeventReactor.php @@ -129,27 +129,6 @@ class LibeventReactor implements SignalReactor { $this->isRunning = false; } - /** - * {@inheritDoc} - * @throws \InvalidArgumentException On invalid future time - */ - public function at(callable $callback, $unixTimeOrStr): string { - $now = time(); - if (is_int($unixTimeOrStr) && $unixTimeOrStr > $now) { - $secondsUntil = ($unixTimeOrStr - $now); - } elseif (($executeAt = @strtotime($unixTimeOrStr)) && $executeAt > $now) { - $secondsUntil = ($executeAt - $now); - } else { - throw new \InvalidArgumentException( - "Unix timestamp or future time string (parsable by strtotime()) required" - ); - } - - $msDelay = $secondsUntil * $this->resolution; - - return $this->once($callback, $msDelay); - } - /** * {@inheritDoc} */ diff --git a/lib/NativeReactor.php b/lib/NativeReactor.php index 547e4d9..eea7a21 100644 --- a/lib/NativeReactor.php +++ b/lib/NativeReactor.php @@ -213,26 +213,6 @@ class NativeReactor implements Reactor { } } - /** - * {@inheritDoc} - */ - public function at(callable $callback, $unixTimeOrStr): string { - $now = time(); - if (is_int($unixTimeOrStr) && $unixTimeOrStr > $now) { - $secondsUntil = ($unixTimeOrStr - $now); - } elseif (($executeAt = @strtotime($unixTimeOrStr)) && $executeAt > $now) { - $secondsUntil = ($executeAt - $now); - } else { - throw new \InvalidArgumentException( - 'Unix timestamp or future time string (parsable by strtotime()) required' - ); - } - - $msDelay = $secondsUntil * $this->resolution; - - return $this->once($callback, $msDelay); - } - /** * {@inheritDoc} */ diff --git a/lib/Reactor.php b/lib/Reactor.php index 28b3f48..ff37af6 100644 --- a/lib/Reactor.php +++ b/lib/Reactor.php @@ -52,15 +52,6 @@ interface Reactor { */ public function repeat(callable $func, int $millisecondDelay): string; - /** - * Schedule an event to trigger once at the specified time - * - * @param callable $func A callback to invoke at the specified future time - * @param int|string $unixTimeOrStr - * @return string Returns unique (to the process) string watcher ID - */ - public function at(callable $func, $unixTimeOrStr): string; - /** * Watch a stream resource for readable data and trigger the callback when actionable * diff --git a/lib/UvReactor.php b/lib/UvReactor.php index 5c5dfeb..2242b28 100644 --- a/lib/UvReactor.php +++ b/lib/UvReactor.php @@ -228,26 +228,6 @@ class UvReactor implements SignalReactor { } } - /** - * {@inheritDoc} - */ - public function at(callable $callback, $unixTimeOrStr): string { - $now = time(); - if (is_int($unixTimeOrStr) && $unixTimeOrStr > $now) { - $secondsUntil = ($unixTimeOrStr - $now); - } elseif (($executeAt = @strtotime($unixTimeOrStr)) && $executeAt > $now) { - $secondsUntil = ($executeAt - $now); - } else { - throw new \InvalidArgumentException( - 'Unix timestamp or future time string (parsable by strtotime()) required' - ); - } - - $msDelay = $secondsUntil * $this->resolution; - - return $this->once($callback, $msDelay); - } - /** * {@inheritDoc} */