1 | <?php |
||
13 | class JobQueue implements JobQueueInterface |
||
14 | { |
||
15 | /** |
||
16 | * QueueManager instance |
||
17 | * |
||
18 | * @var QueueManager |
||
19 | */ |
||
20 | protected $manager; |
||
21 | |||
22 | /** |
||
23 | * JobQueue constructor. |
||
24 | * |
||
25 | * @param QueueManager $manager |
||
26 | * |
||
27 | * @internal param array $config |
||
28 | */ |
||
29 | public function __construct(QueueManager $manager) |
||
33 | |||
34 | /** |
||
35 | * Push new job to queue |
||
36 | * |
||
37 | * @author Virchenko Maksim <[email protected]> |
||
38 | * |
||
39 | * @param string $job |
||
40 | * @param array $data |
||
41 | * @param string $queue |
||
42 | * @param string $connection |
||
43 | * |
||
44 | * @return mixed |
||
45 | */ |
||
46 | public function push(string $job, array $data = [], string $queue = 'default', string $connection = 'default') |
||
50 | |||
51 | /** |
||
52 | * Push new job to queue if this job is not exist |
||
53 | * |
||
54 | * @author Virchenko Maksim <[email protected]> |
||
55 | * |
||
56 | * @param string $job |
||
57 | * @param array $data |
||
58 | * @param string $queue |
||
59 | * @param string $connection |
||
60 | * |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function pushUnique(string $job, array $data = [], string $queue = 'default', string $connection = 'default') |
||
71 | |||
72 | /** |
||
73 | * Push a new an array of jobs onto the queue. |
||
74 | * |
||
75 | * @param array $jobs |
||
76 | * @param mixed $data |
||
77 | * @param string $queue |
||
78 | * @param string $connection |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | public function bulk(array $jobs, array $data = [], string $queue = 'default', string $connection = 'default') |
||
86 | |||
87 | /** |
||
88 | * Push a new job onto the queue after a delay. |
||
89 | * |
||
90 | * @param \DateInterval|int $delay |
||
91 | * @param string $job |
||
92 | * @param mixed $data |
||
93 | * @param string $queue |
||
94 | * @param string $connection |
||
95 | * |
||
96 | * @return mixed |
||
97 | */ |
||
98 | public function later($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default') |
||
102 | |||
103 | /** |
||
104 | * Push a new job into the queue after a delay if job does not exist. |
||
105 | * |
||
106 | * @param \DateInterval|int $delay |
||
107 | * @param string $job |
||
108 | * @param mixed $data |
||
109 | * @param string $queue |
||
110 | * @param string $connection |
||
111 | * |
||
112 | * @return mixed |
||
113 | */ |
||
114 | public function laterUnique($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default') |
||
122 | } |
||
123 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: