jeudi 5 décembre 2019

Laravel Mail ShouldQueue vs Job ShouldQueue

Okay, so I get the idea of ShouldQueue and that it lets the application run more smooth.

But what I don't get, is the difference between using a Mailable with ShouldQueue vs using a Job with ShouldQueue.

If I use Mailable with ShouldQueue and send the mail as I normally would, the mail is queued and should then be send by a worker.

If I use Job with ShouldQueue it does the same thing but with 1 more class (It feels a bit redundant). So in my use case it looks like using Job is a waste of time?

Can anyone please tell me what benefits I would get with using Job over Mailable? :)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire