vendredi 20 mai 2016

In Laravel how to create a queue object and set their connection without Facade

In Lumen/Laravel I want to send a message to a given queue.

by default I have it set to Redis, what I would like is to send it to another queue server as another application will take care of it.

I know I can do $queue->pushRaw('payload'); However there is no subsequent way for me to pick the connection.

I am aware that I can use Facade to create my Queue as such:

$connection = Queue::connection('connection_name');
$connection->pushOn('queue_name', $job)

However I'm doing this in Lumen, and would like to avoid turning on the Facade Just for this aspect. Also, I would like to know how to do this as I would like to pass by IoC through a job event handler eventually.

Version of Lumen/Laravel 5.2.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1YJJ7WZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire