R
R
Romi2021-05-11 16:38:14
Laravel
Romi, 2021-05-11 16:38:14

Is there a fundamental difference between Event-Listener and Jobs="sync"?

Do I understand correctly that instead of the Event-Listener binding, you can easily use Jobs with the "sync" setting and it will be the same result?

If not, why not?

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-05-11
@romicohen

It depends on what you mean by "result".
Functionally, in terms of executable code, there will be no difference. But the coherence of the code will increase, it will become somewhat more difficult to expand it. In a real project, most likely, you will not notice this in practice, especially if the event had only one handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question