1 | <?php |
||
18 | class Worker implements TubeAwareInterface |
||
19 | { |
||
20 | use TubeAwareTrait; |
||
21 | |||
22 | /** @var Server */ |
||
23 | protected $server; |
||
24 | |||
25 | /** @var CommandFactory */ |
||
26 | protected $commandFactory; |
||
27 | |||
28 | /** @var JobFactory */ |
||
29 | protected $jobFactory; |
||
30 | |||
31 | /** |
||
32 | * @param Server $server |
||
33 | */ |
||
34 | 16 | public function __construct(Server $server) |
|
41 | |||
42 | /** |
||
43 | * @param string $tubeName |
||
44 | * @param bool|false $onlyThisTube |
||
45 | * @return $this |
||
46 | */ |
||
47 | 3 | public function watch($tubeName, $onlyThisTube = false) |
|
57 | |||
58 | /** |
||
59 | * @param string $tubeName |
||
60 | * @return $this |
||
61 | */ |
||
62 | 1 | public function ignore($tubeName) |
|
67 | |||
68 | /** |
||
69 | * @throws Exception\InvalidArgumentException |
||
70 | */ |
||
71 | 1 | public function quit() |
|
75 | |||
76 | /** |
||
77 | * @param null|int $timeout |
||
78 | * @return Job|null |
||
79 | */ |
||
80 | 3 | public function reserve($timeout = null) |
|
99 | |||
100 | /** |
||
101 | * @return JobOath |
||
102 | * @throws Exception\InvalidArgumentException |
||
103 | */ |
||
104 | 1 | public function reserveOath() |
|
111 | |||
112 | /** |
||
113 | * @return Server |
||
114 | */ |
||
115 | 3 | public function getServer() |
|
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | 1 | public function __toString() |
|
127 | |||
128 | 1 | public function reconnect() |
|
132 | |||
133 | 1 | public function disconnect() |
|
137 | } |
||
138 |