Enqueue laravel event subscriber

浪尽此生 提交于 2019-12-11 01:03:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!