| @@ 500-508 (lines=9) @@ | ||
| 497 | * Graceful restart |
|
| 498 | * @return void |
|
| 499 | */ |
|
| 500 | public function gracefulRestart() |
|
| 501 | { |
|
| 502 | $this->graceful = true; |
|
| 503 | $this->reload = true; |
|
| 504 | Timer::add(function () { |
|
| 505 | EventLoop::$instance->stop(); |
|
| 506 | }, $this->reloadDelay * 1e6); |
|
| 507 | $this->setState($this->state); |
|
| 508 | } |
|
| 509 | ||
| 510 | /** |
|
| 511 | * Graceful stop |
|
| @@ 514-521 (lines=8) @@ | ||
| 511 | * Graceful stop |
|
| 512 | * @return void |
|
| 513 | */ |
|
| 514 | public function gracefulStop() |
|
| 515 | { |
|
| 516 | $this->graceful = true; |
|
| 517 | Timer::add(function () { |
|
| 518 | EventLoop::$instance->stop(); |
|
| 519 | }, $this->reloadDelay * 1e6); |
|
| 520 | $this->setState($this->state); |
|
| 521 | } |
|
| 522 | ||
| 523 | /** |
|
| 524 | * Asks the running applications the whether we can go to shutdown current (old) worker. |
|