Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hsldymq committed Apr 15, 2019
1 parent e2caa9b commit 17ecfe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/01.basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
->setMessageHandler(function (QueueMessage $message, Worker $worker) {
// 模拟正常处理逻辑
usleep(1000);
})
->registerSignal(SIGINT, function () {
})
->registerSignal(SIGINT, function () {
// Ctrl+C会向前端进程组发送SIGINT信号,我们不希望worker也被这个信号影响,而是希望由dispatcher来控制它的生存周期
})
->registerEvent('error', function (string $reason, \Throwable $e, Worker $worker) {
Expand Down
2 changes: 1 addition & 1 deletion examples/04.prefetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

$params = require __DIR__.'/amqp_params.php';
$conn = new Connection($params['connectionOptions'], $params['queues']);
// !!!!!!!!!!就是这里!!!!!!!!!!!!
// 使用该方法设置prefetch值
$conn->setPrefetch(10);

$dispatcher = (new Dispatcher($conn, $factory))
Expand Down

0 comments on commit 17ecfe7

Please sign in to comment.