richan-fongdasen / laravel-gcr-worker
Easily generates RESTful API endpoints in Laravel
Installs: 57 031
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- illuminate/console: ^8.0|^9.0|^10.0|^11.0
- illuminate/queue: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- kainxspirits/laravel-pubsub-queue: ^0.6|^0.7|^0.8|^0.9
Requires (Dev)
- ekino/phpstan-banned-code: ^1.0
- larastan/larastan: ^1.0|^2.0
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0
- phpmd/phpmd: ^2.11
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- phpunit/phpunit: ^9.5|^10.0|^11.0
README
Laravel GCR Worker
Simple background processing implementation with Google Cloud Run and Google Cloud Pub/Sub
Synopsis
This package would help you to implement any background processing in Laravel like queue worker or scheduled job in Google Cloud Run by handling the triggered HTTP event invocation.
Table of contents
Setup
Install the package via Composer :
$ composer require richan-fongdasen/laravel-gcr-worker
Laravel version compatibility
Configuration
Publish configuration file using php artisan
command
$ php artisan vendor:publish --provider="RichanFongdasen\GCRWorker\ServiceProvider"
The command above would copy a new configuration file to /config/gcr-worker.php
return [ /* |-------------------------------------------------------------------------- | Allow Event invocation |-------------------------------------------------------------------------- | | Specify whether the application would allow and handle any event | invocations, such as Pub/Sub topic message published events, Cloud | scheduler jobs, etc. | */ 'allow_event_invocation' => (bool) env('ALLOW_EVENT_INVOCATION', false), /* |-------------------------------------------------------------------------- | Maximum Execution Time |-------------------------------------------------------------------------- | | Set the max execution time in seconds, the default value is 15 minutes. | | Warning: | This value doesn't update the maximum execution time defined in your | nginx, apache or php-fpm configuration. You need to update them manually. | */ 'max_execution_time' => 60 * 15, /* |-------------------------------------------------------------------------- | Middleware |-------------------------------------------------------------------------- | | Define the middleware which should be attached in every GCR worker route. | */ 'middleware' => [ \Illuminate\Routing\Middleware\SubstituteBindings::class, \RichanFongdasen\GCRWorker\Middleware\AllowEventInvocation::class, ], /* |-------------------------------------------------------------------------- | Path prefix |-------------------------------------------------------------------------- | | Define the path prefix of the Pub/Sub event handler url. | */ 'path_prefix' => 'gcr-worker', ];
Usage
The content for this section is under development.
License
The MIT License (MIT). Please see License File for more information.