1 | <?php |
||
29 | class RedisService { |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @var RedisUtil |
||
34 | */ |
||
35 | private $redisUtil; |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * @var OcrJobMapper |
||
40 | */ |
||
41 | private $mapper; |
||
42 | |||
43 | /** |
||
44 | * |
||
45 | * @var FileUtil |
||
46 | */ |
||
47 | private $fileUtil; |
||
48 | |||
49 | /** |
||
50 | * |
||
51 | * @var ILogger |
||
52 | */ |
||
53 | private $logger; |
||
54 | |||
55 | /** |
||
56 | * |
||
57 | * @var IL10N |
||
58 | */ |
||
59 | private $l10n; |
||
60 | |||
61 | /** |
||
62 | * QueueService constructor. |
||
63 | * |
||
64 | * @param OcrJobMapper $mapper |
||
65 | * @param FileUtil $fileUtil |
||
66 | * @param RedisUtil $redisUtil |
||
67 | * @param IL10N $l10n |
||
68 | * @param ILogger $logger |
||
69 | */ |
||
70 | 8 | public function __construct(OcrJobMapper $mapper, FileUtil $fileUtil, RedisUtil $redisUtil, IL10N $l10n, |
|
78 | |||
79 | /** |
||
80 | * Inits the client and sends the task to the background worker (async) |
||
81 | * |
||
82 | * @param OcrJob $job |
||
83 | * @param string[] $languages |
||
84 | */ |
||
85 | 2 | public function sendJob($job, $languages) { |
|
109 | |||
110 | /** |
||
111 | * Retrieves all finished jobs from redis and returns them. |
||
112 | * |
||
113 | * @return string[] |
||
114 | */ |
||
115 | 1 | public function readingFinishedJobs() { |
|
131 | |||
132 | /** |
||
133 | * Handle the possible thrown Exceptions from all methods of this class. |
||
134 | * |
||
135 | * @param Exception $e |
||
136 | * @throws Exception |
||
137 | * @throws NotFoundException |
||
138 | */ |
||
139 | 1 | private function handleException($e) { |
|
146 | } |