12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- class ProcessManager extends IoManager
- {
- protected $socket;
- public static function get()
- {
- throw new Exception("Must pass ProcessManager per-instance");
- }
- public function __construct($socket)
- {
- $this->socket = $socket;
- }
-
- public static function multiSite()
- {
- return IoManager::INSTANCE_PER_PROCESS;
- }
-
- function getSockets()
- {
- return array($this->socket);
- }
-
- function handleInput($socket)
- {
- if (feof($socket)) {
- common_log(LOG_INFO, "Parent process exited; shutting down child.");
- $this->master->requestShutdown();
- }
- return true;
- }
- }
|