genesisweb/laravel-async-queue
Composer 安装命令:
composer require genesisweb/laravel-async-queue
包简介
Async Queue Driver for Laravel (Push to background) (Forked from barryvdh)
关键字:
README 文档
README
Push a function/closure to the background.
#####Forked for Laravel 6 support, all credits to Barryvdh.
For Laravel 5.4, check the 0.6 branch
For Laravel 5.3, check the 0.5 branch
Just like the 'sync' driver, this is not a real queue driver. It is always fired immediatly. The only difference is that the closure is sent to the background without waiting for the response. This package is more usable as an alternative for running incidental tasks in the background, without setting up a 'real' queue driver.
Note: This is using the DatabaseQueue, so make sure you set that up first, including migrations.
Install
Require the latest version of this package with Composer
composer require genesisweb/laravel-async-queue
Add the Service Provider to the providers array in config/app.php
GenesisWeb\Queue\AsyncServiceProvider::class,
You need to create the migration table for queues and run it.
$ php artisan queue:table
$ php artisan migrate
You should now be able to use the async driver in config/queue.php. Use the same config as for the database, but use async as driver.
'connections' => array(
...
'async' => array(
'driver' => 'async',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
),
...
}
Set the default to async, either by changing to config or setting QUEUE_DRIVER in your .env file to async.
Note: By default,
phpis used as the binary path to PHP. You can change this by adding thebinaryoption to the queue config. You can also add extra arguments (for HHVM for example)
'connections' => array(
...
'async' => array(
'driver' => 'async',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
'binary' => 'php',
'binary_args' => '',
),
...
}
It should work the same as the sync driver, so no need to run a queue listener. Downside is that you cannot actually queue or plan things. Queue::later() is also fired directly. For more info see http://laravel.com/docs/queues
genesisweb/laravel-async-queue 适用场景与选型建议
genesisweb/laravel-async-queue 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 147 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 09 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「queue」 「background」 「async」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 genesisweb/laravel-async-queue 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 genesisweb/laravel-async-queue 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 genesisweb/laravel-async-queue 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides a background task processing module.
PHP AMQP Binding Library
The bundle for easy using json-rpc api on your project
An async event for hyperf.
A Laravel package to monitor queue jobs.
A minimum library to run background processes asynchronously.
统计信息
- 总下载量: 147
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-07