1 | <?php |
||
20 | abstract class AbstractStrategy extends Object implements StrategyInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var MultipleQueueInterface |
||
24 | */ |
||
25 | protected $queue; |
||
26 | |||
27 | /** |
||
28 | * Sets the queue. |
||
29 | * |
||
30 | * @param MultipleQueueInterface $queue |
||
31 | * @return void |
||
32 | */ |
||
33 | public function setQueue(MultipleQueueInterface $queue) |
||
37 | |||
38 | /** |
||
39 | * Implement this for the strategy of getting job from the queue. |
||
40 | * |
||
41 | * @return JobInterface[]|false |
||
42 | */ |
||
43 | abstract protected function getJobFromQueues(); |
||
44 | |||
45 | /** |
||
46 | * Returns the job. |
||
47 | * |
||
48 | * @return JobInterface|boolean |
||
49 | */ |
||
50 | public function fetch() |
||
64 | |||
65 | /** |
||
66 | * Delete the job from the queue. |
||
67 | * |
||
68 | * @param JobInterface $job The job. |
||
69 | * @return boolean whether the operation succeed. |
||
70 | */ |
||
71 | public function delete(JobInterface $job) |
||
87 | } |
||
88 |