eee
This commit is contained in:
@@ -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::add($this->pipe, function () use ($process) {
|
||||||
|
$read = inotify_read($this->pipe);
|
||||||
|
if (!empty($read)) {
|
||||||
|
$this->reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
Event::cycle(function (): void {
|
Event::cycle(function (): void {
|
||||||
if ($this->isStop()) {
|
if ($this->isStop()) {
|
||||||
$read = inotify_read($this->pipe);
|
|
||||||
if (!empty($read)) {
|
|
||||||
$this->reload();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Event::exit();
|
Event::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::dispatch();
|
|
||||||
});
|
});
|
||||||
Event::wait();
|
Event::wait();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user