chefsplate/laravel-mongodb-queue
Composer 安装命令:
composer require chefsplate/laravel-mongodb-queue
包简介
Thread-safe MongoDB database queue implementation for Laravel
README 文档
README
Thread-safe MongoDB database queue implementation for Laravel.
This driver is compatible with jensseger's
laravel-mongodb library,
however we use the mongodb client instead so we can leverage
findAndModify updates with write concerns and $isolated operations.
Requirements
- PHP 5.4+
- mongodb-1.1.x PHP driver (or higher)
- Mongo 3.x+ (see note below*)
- Laravel 5.3 (for Laravel 5.1 or 5.2 support, please use the 5.1 branch)
- You may also leverage laravel-mongodb in your project
*Note: Although concurrency and locking have been implemented since Mongo 2.2, the locking is done at the database level, which makes it highly non-performant. Since Mongo 3.0, collection-level and even document-level locking has been added. Future updates may leverage bulk updates which have been added in Mongo 3.2, which make it the ideal minimum version to install.
For more details on driver compatibility, please see the MongoDB ecosystem documentation.
Install
Require the latest version of this package with Composer:
composer require chefsplate/laravel-mongodb-queue:"^1.0.0"
Add the Service Provider to the providers array in config/app.php:
ChefsPlate\Queue\MongoDBServiceProvider::class,
You should now be able to use the mongodb driver in config/queue.php. (Use the same config as for the database, but use mongodb as the driver.)
'default' => 'mongodb',
'connections' => array(
...
'mongodb' => array(
'driver' => 'mongodb',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
),
...
}
Note: Mongo will automatically create the jobs collection. No database migration is needed.
Please ensure your config/database.php configuration for mongodb includes a DSN. This is required by our driver:
'mongodb' => array(
'driver' => 'mongodb',
'dsn' => 'mongodb://127.0.0.1:27017',
'database' => 'database_name'
),
The format for the DSN is:
mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db
For more info see:
chefsplate/laravel-mongodb-queue 适用场景与选型建议
chefsplate/laravel-mongodb-queue 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.86k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2016 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「queue」 「mongodb」 「mongo」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chefsplate/laravel-mongodb-queue 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chefsplate/laravel-mongodb-queue 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chefsplate/laravel-mongodb-queue 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Generates Symfony2 documents, forms and CRUD
Store your language lines in the database, yaml or other sources
PHP AMQP Binding Library
A Laravel package to monitor queue jobs.
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
统计信息
- 总下载量: 5.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-17