1 | <?php |
||
12 | class NotifyHandler implements INotifyHandler { |
||
13 | /** |
||
14 | * @var Connection |
||
15 | */ |
||
16 | private $connection; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $path; |
||
22 | |||
23 | private $listening = true; |
||
24 | |||
25 | /** |
||
26 | * @param Connection $connection |
||
27 | * @param string $path |
||
28 | */ |
||
29 | public function __construct(Connection $connection, $path) { |
||
33 | |||
34 | /** |
||
35 | * Get all changes detected since the start of the notify process or the last call to getChanges |
||
36 | * |
||
37 | * @return Change[] |
||
38 | */ |
||
39 | public function getChanges() { |
||
51 | |||
52 | /** |
||
53 | * Listen actively to all incoming changes |
||
54 | * |
||
55 | * Note that this is a blocking process and will cause the process to block forever if not explicitly terminated |
||
56 | * |
||
57 | * @param callable $callback |
||
58 | */ |
||
59 | public function listen($callback) { |
||
66 | |||
67 | private function parseChangeLine($line) { |
||
79 | |||
80 | public function stop() { |
||
84 | |||
85 | public function __destruct() { |
||
88 | } |
||
89 |