jcsmith1859 / illuminate-resque
Illuminate Resque 连接器,用于 Laravel 队列类。
1.0.6
2016-01-12 22:12 UTC
Requires
- php: >=5.4.0
- illuminate/queue: 5.2.*
- php-resque/resque: dev-master
Suggests
- kamisama/php-resque-scheduler: Enables the use of the ResqueScheduler functionality.
This package is not auto-updated.
Last update: 2024-09-24 18:51:08 UTC
README
此包允许您在使用 Queue 时连接到 Resque。
这是基于 awillis13 的 laravel-resque 的分支,使用了 kamisama 对 chrisboulton 的 php-resque 的分支。
要求
- PHP 5.4+
安装
将以下内容添加到项目的 composer.json 文件中
"require": {
"deedod/laravel-resque-ex": "1.0.*"
}
现在您需要运行以下命令来安装包
composer update
接下来,您需要将以下服务提供者添加到 app/config/app.php 文件中
'Resque\ServiceProviders\ResqueServiceProvider'
现在您需要将以下内容添加到 /app/config/queue.php 文件的 "connections" 部分
"resque" => [
"driver" => "resque"
]
如果您希望使用此驱动作为默认队列驱动程序,您需要在 app/config/queue.php 文件中将以下内容设置为 "default" 驱动
"default" => "resque",
用法
如果您选择不使用此驱动作为默认队列驱动程序,您可以通过以下方式按需调用队列方法
Queue::connection('resque')->push('JobName', ['name' => 'Andrew']);
队列作业入队
Queue::push('JobName', ['name' => 'Andrew']);
跟踪作业
$token = Queue::push('JobName', ['name' => 'Andrew'], true);
$status = Queue::getStatus($token);
队列未来的作业
$when = time() + 3600; // 1 hour from now
Queue::later($when, 'JobName', ['name' => 'Andrew']);
进一步文档
许可协议
Laravel Resque 是开源软件,根据 MIT 许可协议 授权。