PHP code example of munir131 / laravel-pubsub-queue

1. Go to this page and download the library: Download munir131/laravel-pubsub-queue 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/ */

    

munir131 / laravel-pubsub-queue example snippets


PubSub\PubSubQueue\PubSubQueueServiceProvider::class,

'pubsub' => [
            'driver' => 'pubsub',
            'queue' => env('JOB_PUB'),
            'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'),
            'retries' => 5,
            'request_timeout' => 60,
            'keyFilePath' => env('PUBSUB_KEY_FILE', storage_path('Asyncro-978055.json')),
            // Subscriber will be key and publisher will be value here
            'subscribers' => [
                'sub1' => 'topic1',
                'sub2' => 'topic2',
                'sub3' => 'topic2' // Multiple subscriber to single topic
            ],
            'plain_handlers' => [
                'plain_sub' => App\Jobs\PlainClass::class // This one for non laravel format messages.
            ],
        ],