PHP code example of tusimo / laravel-delay-queue

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

    

tusimo / laravel-delay-queue example snippets



return [
    'providers' => [
        /*
         * Package Service Providers...
         */
        Tusimo\DelayedQueue\Provider\DelayedQueueServiceProvider::class,
    ]
];

'redis' => [
            'driver'      => 'redis',
            'connection'  => 'default',
            'queue'       => 'default',
            'retry_after' => 60,
            'delay'       => true
        ]

public function report(Exception $exception)
    {
        //清空已经保存的队列任务
        DelayQueueContainer::flushQueueJobs();
        
        //获取已保存的队列任务
        DelayQueueContainer::getQueueJobs();
        
        //立即将已保存的队列任务放入队列后台
        DelayQueueContainer::fireQueueJobs()
        
        if ($this->shouldntReport($exception)) {
            return;
        }
        app(ErrorReporter::class)->report($exception);
    }
 DelayQueueContainer::fireQueueJobs();