1 | <?php |
||
25 | abstract class AbstractGearmanService |
||
26 | { |
||
27 | /** |
||
28 | * All workers |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $workers; |
||
33 | |||
34 | /** |
||
35 | * The prefix for all job names |
||
36 | * |
||
37 | * @var string $jobPrefix |
||
38 | */ |
||
39 | protected $jobPrefix = null; |
||
40 | |||
41 | /** |
||
42 | * Construct method |
||
43 | * |
||
44 | * @param GearmanCacheWrapper $gearmanCacheWrapper GearmanCacheWrapper |
||
45 | * @param array $defaultSettings The default settings for the bundle |
||
46 | */ |
||
47 | 3 | public function __construct(GearmanCacheWrapper $gearmanCacheWrapper, array $defaultSettings) |
|
56 | |||
57 | /** |
||
58 | * Return worker containing a job with $jobName as name |
||
59 | * If is not found, throws JobDoesNotExistException Exception |
||
60 | * |
||
61 | * @param string $jobName Name of job |
||
62 | * |
||
63 | * @return array |
||
64 | * |
||
65 | * @throws JobDoesNotExistException |
||
66 | */ |
||
67 | 1 | public function getJob($jobName) |
|
89 | |||
90 | /** |
||
91 | * Return worker with $workerName as name and all its jobs |
||
92 | * If is not found, throws WorkerDoesNotExistException Exception |
||
93 | * |
||
94 | * @param string $workerName Name of worker |
||
95 | * |
||
96 | * @return array |
||
97 | * |
||
98 | * @throws WorkerDoesNotExistException |
||
99 | */ |
||
100 | public function getWorker($workerName) |
||
111 | |||
112 | /** |
||
113 | * Return array of workers |
||
114 | * |
||
115 | * @return array all available workers |
||
116 | */ |
||
117 | public function getWorkers() |
||
121 | } |
||
122 |