Controlling the tubes for Queued Events in Laravel 5 -


so i've started using queued events in l5 handling logic , wondering if possible tell laravel tube use when pushing events onto beanstalkd.

i couldn't see in documentation it.

after digging through event dispatcher code.

i found if there queue method on event handler laravel pass arguments through method , let call push method manually.

so if have sendemail event handler can this:

<?php namespace app\handlers\events;  use app\events\userwascreated;  use illuminate\queue\interactswithqueue; use illuminate\contracts\queue\shouldbequeued;  class sendemail implements shouldbequeued {     use interactswithqueue;      public function __construct()     {     }      public function queue($queue, $job, $args)     {         // manually call push         $queue->push($job, $args, 'tubenamehere');         // or pushon         $queue->pushon('tubenamehere', $job, $args);     }      public function handle(userwascreated $event)     {         // handle event here     } } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -