File tree Expand file tree Collapse file tree 3 files changed +1
-15
lines changed Expand file tree Collapse file tree 3 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 66依赖
77--------
88* PHP5.4+
9- * Composer
109* ext-pcntl
1110
1211安装
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use DelayQueue\Process\Worker;
88use DelayQueue \DelayQueue ;
99use DelayQueue \Container \Container ;
1010
11- require __DIR__ . '/../vendor /autoload.php ' ;
11+ require __DIR__ . '/../../.. /autoload.php ' ;
1212
1313
1414if (php_sapi_name () !== 'cli ' ) {
Original file line number Diff line number Diff line change 2222try {
2323 // 添加一个Job到延迟队列
2424 $ delayQueue ->push ($ className , $ job );
25-
26- // 从延迟队列中删除Job
27- $ delayQueue ->delete ('15702398321 ' );
28-
29- // 从队列中取出已过期的Job
30- $ data = $ delayQueue ->pop (['order ' ]);
31- // $data['className'] 处理Job的类名
32- // $data['id'] Job唯一标识
33- // $data['body'] Job自定义Body
34-
35-
36- // Job处理完成, 确认删除
37- $ delayQueue ->finish ('15702398321 ' );
3825} catch (Exception $ exception ) {
3926 echo $ exception ->getMessage ();
4027}
You can’t perform that action at this time.
0 commit comments