Package Data | |
---|---|
Maintainer Username: | chefxu |
Maintainer Contact: | rssidea@qq.com (rssidea) |
Package Create Date: | 2016-05-13 |
Package Last Update: | 2017-08-04 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-22 03:00:51 |
Package Statistics | |
---|---|
Total Downloads: | 141 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
这个包的目的不是为了封装阿里云官方的MNS sdk,而是为了给laravel提供基于MNS的队列驱动,让现有的使用laravel队列的程序可以方便的切换到阿里云MNS上。
composer require stone/aliyun_mns:dev-master
修改 config/queue.php, 新增mns配置:
'connections' => array(
'sync' => array(
'driver' => 'sync',
),
'redis' => array(
'driver' => 'redis',
'queue' => 'default',
),
// 新增配置项
'aliyunmns' => array(
'driver' => 'aliyunmns',
'queue' => 'default',
),
),
// mns服务配置
'mns' => [
'key' => 'xxxxx',
'secret' => 'xxxxx',
'baseuri' => 'http://xxxxx.aliyuncs.com',
// 队列名称对应关系
'queue' => [
'default' => 'shop-demo',
],
],
扩展队列驱动
Queue::extend('aliyunmns', function()
{
return new Stone\Queue\Connectors\AliyunMNSConnector();
});
正常使用Laravel Queue 即可: https://laravel.com/docs/5.2/queues