| 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 | * @param ClientSession $session |
||
| 40 | */ |
||
| 41 | protected function setClientSession(ClientSession $session) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Start the monitor. |
||
| 48 | * |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | public function start() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Stop the monitor. |
||
| 61 | * Returns boolean wether the monitor could be started. |
||
| 62 | * |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | public function stop() |
||
| 75 | |||
| 76 | protected function getList() |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Get the monitor's WAMP client session. |
||
| 83 | * |
||
| 84 | * @return ClientSession |
||
| 85 | */ |
||
| 86 | public function getServerSession() |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Get the monitor's running state. |
||
| 93 | * |
||
| 94 | * @return bool |
||
| 95 | */ |
||
| 96 | public function isRunning() |
||
| 100 | } |
||
| 101 |