ankurgoels / laravel-pubsub-queue
Google Cloud Pub/Sub 的队列驱动程序。
0.4.3
2020-08-09 14:26 UTC
Requires
- php: >=7.2
- ext-json: *
- google/cloud-pubsub: ^1.1
- illuminate/queue: 5.7.* | 5.8.* | ^6.0 | ^7.0
- illuminate/support: 5.7.* | 5.8.* | ^6.0 | ^7.0
- ramsey/uuid: ^2.0|^3.0|^4.0
Requires (Dev)
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2024-09-10 04:17:50 UTC
README
本包是使用 Google PubSub 服务的 Laravel 队列驱动程序。
安装
您可以使用 Composer 安装此包,只需运行以下命令:
composer require ankurgoels/laravel-pubsub-queue
如果您已禁用包发现,您仍然可以通过将以下行添加到您的 config/app.php
文件的提供者中手动注册此包:
Kainxspirits\PubSubQueue\PubSubQueueServiceProvider::class,
配置
将 pubsub
连接添加到您的 config/queue.php
文件中。从那里,您可以使用原始 Pub/Sub 客户端的所有配置值。只需确保使用 snake_case 作为键的名称。
有关不同选项的更多详细信息,请参阅 Google Cloud PubSub 客户端。
'pubsub' => [ 'driver' => 'pubsub', 'queue' => env('PUBSUB_QUEUE', 'default'), 'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'), 'retries' => 3, 'request_timeout' => 60, 'keyFile' => json_decode(file_get_contents(storage_path('keys/pubsub.json')), true), ],
测试
您可以使用以下命令运行测试:
vendor/bin/phpunit
许可证
本项目受 MIT 许可证的约束。有关更多信息,请参阅许可证文件。