PHP code example of twipi-group / googlecloud-pubsub-laravel-queue-driver

1. Go to this page and download the library: Download twipi-group/googlecloud-pubsub-laravel-queue-driver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

twipi-group / googlecloud-pubsub-laravel-queue-driver example snippets


TwipiGroup\GoogleCloudPubSubLaravelQueueDriver\GcServiceProviderQueue::class,

$app->configure('queue');
$app->register(TwipiGroup\GoogleCloudPubSubLaravelQueueDriver\GcServiceProviderQueue::class);

'gcpubsub' => [
    'driver' => 'gcpubsub',
    'project_id' => env('PUBSUB_PROJECT_ID', 'google-cloud-project-id'), // Google cloud project id
    'queue' => env('PUBSUB_QUEUE_DEFAULT', 'default'), // Default queue name corresponding to the gc pubsub topic
    'topic_suffix' => env('PUBSUB_TOPIC_SUFFIX', ''),
    'subscriber_suffix' => env('PUBSUB_SUBSCRIBER_SUFFIX', ''),
    'max_tries' => env('PUBSUB_JOB_MAX_TRIES', 1), // Number of times the job may be attempted.
    'retry_delay' => env('PUBSUB_JOB_RETRY_DELAY', 0), // Delay in seconds before retrying a job that has failed 
],

php artisan queue:work gcpubsub [--queue=myqueue]