1 | <?php |
||
30 | class RedisService { |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @var RedisUtil |
||
35 | */ |
||
36 | private $redisUtil; |
||
37 | |||
38 | /** |
||
39 | * |
||
40 | * @var OcrJobMapper |
||
41 | */ |
||
42 | private $mapper; |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * @var FileUtil |
||
47 | */ |
||
48 | private $fileUtil; |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | * @var ILogger |
||
53 | */ |
||
54 | private $logger; |
||
55 | |||
56 | /** |
||
57 | * |
||
58 | * @var IL10N |
||
59 | */ |
||
60 | private $l10n; |
||
61 | |||
62 | /** |
||
63 | * |
||
64 | * @var ITempManager |
||
65 | */ |
||
66 | private $tempM; |
||
67 | |||
68 | /** |
||
69 | * QueueService constructor. |
||
70 | * |
||
71 | * @param OcrJobMapper $mapper |
||
72 | * @param FileUtil $fileUtil |
||
73 | * @param RedisUtil $redisUtil |
||
74 | * @param IL10N $l10n |
||
75 | * @param ILogger $logger |
||
76 | */ |
||
77 | 8 | public function __construct(OcrJobMapper $mapper, FileUtil $fileUtil, RedisUtil $redisUtil, IL10N $l10n, |
|
86 | |||
87 | /** |
||
88 | * Inits the client and sends the task to the background worker (async) |
||
89 | * |
||
90 | * @param OcrJob $job |
||
91 | * @param string[] $languages |
||
92 | */ |
||
93 | 2 | public function sendJob($job, $languages) { |
|
117 | |||
118 | /** |
||
119 | * Retrieves all finished jobs from redis and returns them. |
||
120 | * |
||
121 | * @return string[] |
||
122 | */ |
||
123 | 1 | public function readingFinishedJobs() { |
|
140 | |||
141 | /** |
||
142 | * Handle the possible thrown Exceptions from all methods of this class. |
||
143 | * |
||
144 | * @param Exception $e |
||
145 | * @throws Exception |
||
146 | * @throws NotFoundException |
||
147 | */ |
||
148 | 1 | private function handleException($e) { |
|
156 | } |