2017 © Pedro Peláez
 

library mailbox

image

davin-bao/mailbox

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

mailbox

Config Redis

  • Go to app/config/database.php, add code:
'redis' => array(

        'cluster' => false,

        'default' => array(
            'host'     => '127.0.0.1',
            'port'     => 6379,
            'database' => 0,
        ),

    ),
  • Go to app/config/cache.php, modify the code:
  ...
  'driver' => 'redis',
  ...

Multi Queue Config

  • Go to app/config/queue.php, add code:
...
'default' => 'low',
...

    'connections' => array(

        ...

    'high' => array(
      'driver' => 'redis',
      'queue'  => 'high',
    ),
    'low' => array(
      'driver' => 'redis',
      'queue'  => 'low',
    ),

    ),
  • Open CMD, and run command: php artisan queue:listen --queue=low --sleep=0 --timeout=0
  • Open CMD, and run command: php artisan queue:listen --queue=high --sleep=0 --timeout=0
  • Add queue:
  \Queue::push(function($job)
  {
     \Log::info('10This is was written via the MailWorker class at '.time().', id is '.$job->getJobId());
     $job->release(10);
  },array('message' => 'aa'), 'high');

  \Queue::push( '\DavinBao\Mailbox\MailWorker@receiveMail', array('message' => 'aa'), 'low');

The Versions

19/08 2016

dev-master

9999999-dev

  Sources   Download

The Requires