问题
I'm handling multiple events through an Event Subscriber instead making separated Events/Listeners. I would like to enqueue several of these events but I didn't find a way to accomplish that. I've followed the official documentation (https://laravel.com/docs/5.2/events#event-subscribers), but there is no clue of how to choose what events I want to enqueue(neither all the subscriber).
Any suggestions? (No individual Event/Listener, please)
Thanks in advance!
回答1:
If anyone is interested in, I've found the solution looking deeper in the Event Dispatcher.
Implementing the contract ShouldQueue on the EventSubscriber works the same than a separated Event/Listener and enqueue the events on the database. This should be documented in the official site.
Regards.
来源:https://stackoverflow.com/questions/36778210/enqueue-laravel-event-subscriber