This commit is contained in:
xl
2024-11-18 14:19:31 +08:00
parent ddf25de2c5
commit 263b4d53eb
+5 -5
View File
@@ -81,17 +81,17 @@ class HotReload extends AbstractProcess
public function process(Process|null $process): void public function process(Process|null $process): void
{ {
$this->addListen(); $this->addListen();
Event::cycle(function (): void {
if ($this->isStop()) { Event::add($this->pipe, function () use ($process) {
$read = inotify_read($this->pipe); $read = inotify_read($this->pipe);
if (!empty($read)) { if (!empty($read)) {
$this->reload(); $this->reload();
} }
} else { });
Event::cycle(function (): void {
if ($this->isStop()) {
Event::exit(); Event::exit();
} }
Event::dispatch();
}); });
Event::wait(); Event::wait();
} }