Skip to content

davin-bao/mailbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages