| 1 | <?php |
||
| 8 | class Fork |
||
| 9 | { |
||
| 10 | /** @var int */ |
||
| 11 | private $pid; |
||
| 12 | |||
| 13 | /** @var \Ackintosh\Snidel\Pcntl */ |
||
| 14 | private $pcntl; |
||
| 15 | |||
| 16 | /** @var \Ackintosh\Snidel\DataRepository */ |
||
| 17 | private $dataRepository; |
||
| 18 | |||
| 19 | /** @var int */ |
||
| 20 | private $status; |
||
| 21 | |||
| 22 | /** @var callable */ |
||
| 23 | private $callable; |
||
| 24 | |||
| 25 | /** @var array */ |
||
| 26 | private $args; |
||
| 27 | |||
| 28 | /** @var \Ackintosh\Snidel\Result */ |
||
| 29 | private $result; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param int $pid |
||
| 33 | */ |
||
| 34 | public function __construct($pid) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * set exit status |
||
| 43 | * |
||
| 44 | * @param int $status |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | public function setStatus($status) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * return pid |
||
| 54 | * |
||
| 55 | * @return int |
||
| 56 | */ |
||
| 57 | public function getPid() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * return exit status |
||
| 64 | * |
||
| 65 | * @return int |
||
| 66 | */ |
||
| 67 | public function getStatus() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * set callable |
||
| 74 | * |
||
| 75 | * @param callable $callable |
||
| 76 | * @return void |
||
| 77 | */ |
||
| 78 | public function setCallable($callable) |
||
| 82 | |||
| 83 | public function getCallable() |
||
| 87 | |||
| 88 | /** |
||
| 89 | * set arguments |
||
| 90 | * |
||
| 91 | * @param array $args |
||
| 92 | * @return void |
||
| 93 | */ |
||
| 94 | public function setArgs($args) |
||
| 98 | |||
| 99 | public function getArgs() |
||
| 103 | /** |
||
| 104 | * @return bool |
||
| 105 | */ |
||
| 106 | public function isSuccessful() |
||
| 110 | |||
| 111 | /** |
||
| 112 | * load result |
||
| 113 | * |
||
| 114 | * @return void |
||
| 115 | * @throws \Ackintosh\Snidel\Exception\SharedMemoryControlException |
||
| 116 | */ |
||
| 117 | public function loadResult() |
||
| 125 | |||
| 126 | /** |
||
| 127 | * return result |
||
| 128 | * |
||
| 129 | * @return \Ackintosh\Snidel\Result |
||
| 130 | */ |
||
| 131 | public function getResult() |
||
| 135 | } |
||
| 136 |