| 1 | <?php |
||
| 20 | trait MonitorTrait |
||
| 21 | { |
||
| 22 | use EventEmitterTrait; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The monitor's WAMP client session. |
||
| 26 | * |
||
| 27 | * @var ClientSession |
||
| 28 | */ |
||
| 29 | protected $session; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Wether the monitor is running. |
||
| 33 | * |
||
| 34 | * @var bool |
||
| 35 | */ |
||
| 36 | protected $isRunning = false; |
||
| 37 | |||
| 38 | |||
| 39 | /** |
||
| 40 | * @param ClientSession $session |
||
| 41 | */ |
||
| 42 | protected function setClientSession(ClientSession $session) |
||
| 43 | { |
||
| 44 | $this->session = $session; |
||
| 45 | } |
||
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * Start the monitor. |
||
| 50 | * |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | public function start() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Stop the monitor. |
||
| 63 | * Returns boolean wether the monitor could be started. |
||
| 64 | * |
||
| 65 | * @return bool |
||
| 66 | */ |
||
| 67 | public function stop() |
||
| 77 | |||
| 78 | protected function getList() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Get the monitor's WAMP client session. |
||
| 85 | * |
||
| 86 | * @return ClientSession |
||
| 87 | */ |
||
| 88 | public function getServerSession() |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Get the monitor's running state. |
||
| 95 | * |
||
| 96 | * @return bool |
||
| 97 | */ |
||
| 98 | public function isRunning() |
||
| 102 | } |
||
| 103 |