完成队列的实现

This commit is contained in:
giaogiao 2024-03-07 19:47:35 +08:00
parent 88b0989dfe
commit 018597fe2a
2 changed files with 23 additions and 18 deletions

View File

@ -54,3 +54,7 @@ All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
更多细节参阅 [LICENSE.txt](LICENSE.txt) 更多细节参阅 [LICENSE.txt](LICENSE.txt)
php think queue:listen --queue helloJobQueue

View File

@ -10,30 +10,31 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
return [ return [
'default' => 'sync', 'default' => 'database',
'connections' => [ 'connections' => [
'sync' => [ // 'sync' => [
'type' => 'sync', // 'type' => 'sync',
], // ],
'database' => [ 'database' => [
'type' => 'database', 'type' => 'database',
'queue' => 'default', 'queue' => 'default',
'table' => 'jobs', 'table' => 'jobs',
'connection' => null, 'connection' => null,
], ],
// 'redis' => [ // 'redis' => [
// 'type' => 'redis', // 'type' => 'redis',
// 'queue' => 'default', // 'queue' => 'default',
// 'host' => '127.0.0.1', // 'host' => '127.0.0.1',
// 'port' => 6379, // 'port' => 6379,
// 'password' => '', // 'password' => '',
// 'select' => 0, // 'select' => 0,
// 'timeout' => 0, // 'timeout' => 0,
// 'persistent' => false, // 'persistent' => false,
// ], // ],
], // ],
'failed' => [ // 'failed' => [
'type' => 'none', // 'type' => 'none',
'table' => 'prefix_jobs', // 'table' => 'failed_jobs',
], ],
]; ];