PHP code example of yuyue8 / tp_queue

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

    

yuyue8 / tp_queue example snippets


/** @var Sms $job */
$job = app(Sms::class);
$job->dispatch(['参数1','参数2'...]);
$job->dispatchSece('延迟时间',['参数1','参数2'...]);
$job->dispatchDo('执行方法名',['参数1','参数2'...],'延长时间');

php think make:jobs /data/jobs/Sms
bash
&> php think queue:listen
php think queue:listen --queue Sms

&> php think queue:work