Changeset View
Changeset View
Standalone View
Standalone View
src/phage/agent/PhagePHPAgent.php
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | private function resolveFuture($key, Future $future) { | ||||
$master->write( | $master->write( | ||||
array( | array( | ||||
'type' => 'RSLV', | 'type' => 'RSLV', | ||||
'key' => $key, | 'key' => $key, | ||||
'err' => $result[0], | 'err' => $result[0], | ||||
'stdout' => $result[1], | 'stdout' => $result[1], | ||||
'stderr' => $result[2], | 'stderr' => $result[2], | ||||
)); | )); | ||||
unset($this->exec[$key]); | |||||
} | } | ||||
public function __destruct() { | public function __destruct() { | ||||
$this->terminateAgent(); | $this->terminateAgent(); | ||||
} | } | ||||
private function terminateAgent() { | private function terminateAgent() { | ||||
foreach ($this->exec as $key => $future) { | foreach ($this->exec as $key => $future) { | ||||
$future->resolveKill(); | $future->resolveKill(); | ||||
} | } | ||||
exit(0); | exit(0); | ||||
} | } | ||||
} | } |