Skip to content

Commit a53c764

Browse files
committed
fix: 修复命令行脚本delayqueue.php自动加载路径错误
1 parent f45300a commit a53c764

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
依赖
77
--------
88
* PHP5.4+
9-
* Composer
109
* ext-pcntl
1110

1211
安装

bin/delayqueue-php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use DelayQueue\Process\Worker;
88
use DelayQueue\DelayQueue;
99
use DelayQueue\Container\Container;
1010

11-
require __DIR__ . '/../vendor/autoload.php';
11+
require __DIR__ . '/../../../autoload.php';
1212

1313

1414
if (php_sapi_name() !== 'cli') {

demo/demo.php

-13
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@
2222
try {
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
}

0 commit comments

Comments
 (0)