1 | <?php |
||
22 | class MnsQueue extends Queue implements QueueContract |
||
23 | { |
||
24 | /** |
||
25 | * @var MnsAdapter |
||
26 | */ |
||
27 | protected $mns; |
||
28 | |||
29 | /** |
||
30 | * Custom callable to handle jobs. |
||
31 | * |
||
32 | * @var callable |
||
33 | */ |
||
34 | protected $jobCreator; |
||
35 | |||
36 | /** |
||
37 | * The name of default queue. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $default; |
||
42 | |||
43 | 7 | public function __construct(MnsAdapter $mns) |
|
49 | |||
50 | /** |
||
51 | * Push a new job onto the queue. |
||
52 | * |
||
53 | * @param string $job |
||
54 | * @param mixed $data |
||
55 | * @param string $queue |
||
56 | * |
||
57 | * @return mixed |
||
58 | */ |
||
59 | 1 | public function push($job, $data = '', $queue = null) |
|
65 | |||
66 | /** |
||
67 | * Push a raw payload onto the queue. |
||
68 | * |
||
69 | * @param string $payload |
||
70 | * @param string $queue |
||
71 | * @param array $options |
||
72 | * |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 1 | public function pushRaw($payload, $queue = null, array $options = []) |
|
82 | |||
83 | /** |
||
84 | * Push a new job onto the queue after a delay. |
||
85 | * |
||
86 | * @param \DateTime|int $delay |
||
87 | * @param string $job |
||
88 | * @param mixed $data |
||
89 | * @param string $queue |
||
90 | * |
||
91 | * @return mixed |
||
92 | */ |
||
93 | 2 | public function later($delay, $job, $data = '', $queue = null) |
|
102 | |||
103 | /** |
||
104 | * Pop the next job off of the queue. |
||
105 | * |
||
106 | * @param string $queue |
||
107 | * |
||
108 | * @return \Illuminate\Queue\Jobs\Job|null |
||
109 | */ |
||
110 | 3 | public function pop($queue = null) |
|
111 | { |
||
112 | 3 | $queue = $this->getDefaultIfNull($queue); |
|
113 | |||
114 | try { |
||
115 | 3 | $response = $this->mns->setQueue($queue)->receiveMessage(); |
|
116 | 3 | } catch (MessageNotExistException $e) { |
|
|
|||
117 | 1 | $response = null; |
|
118 | } |
||
119 | |||
120 | 3 | if ($response) { |
|
121 | 2 | if ($this->jobCreator) { |
|
122 | 1 | return call_user_func($this->jobCreator, $this->container, $queue, $response); |
|
123 | } else { |
||
124 | 1 | return new Jobs\MnsJob($this->container, $this->mns, $queue, $response); |
|
125 | } |
||
126 | } |
||
127 | |||
128 | 1 | return; |
|
129 | } |
||
130 | |||
131 | /** |
||
132 | * 获取默认队列名(如果当前队列名为 null)。 |
||
133 | * |
||
134 | * @param string|null $wanted |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | 4 | public function getDefaultIfNull($wanted) |
|
142 | |||
143 | /** |
||
144 | * 设置使用特定的回调函数处理 job。 |
||
145 | * |
||
146 | * @param callable $callback |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | 1 | public function createJobsUsing(callable $callback) |
|
156 | } |
||
157 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.