Laravel: Optimize Queue Jobs To Be 'Dumb' With Fewer Parameters

preview_player
Показать описание
I will show you a before/after practical example of queue jobs, if we pass the full object, or if we pass the exact variable values only.

Related links:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

cool. I would use contructor() to deconstruct object and store what I want to be use in handle() later on.

michaelcrash
Автор

Your pronunciation of Portuguese names is very good! :)

jrplops
Автор

I learned this the hard way, real hard.

daleryanaldover
Автор

Great video. Thanks for the mention, Povilas!

Автор

For Real, we learn a lot from your videos.
Thanks.

nadjinmalade
Автор

It's a huge time optimization, but it's important to pass a model instance for some cases, for illuminate, what if you need to queue sending mails when the user write his email and let's assume that the user wrote an invalid mail and he realized that after clicking submit button, in this case when the queue get started working he will not recieve any email because we pass his mail not model instance, but what if after realizing that he wrote invalid mail, he write a valid one, and we pass model instance, Laravel will retrieve the last mail because Laravel uses the `SerializesModels` trait.

mmramadan
Автор

What if i need to store results from job to database? Or if i want to save job status in database (if it was successful)? Is there any good practices on these cases? Thank you.

linasgutauskas
Автор

Sir, can i ask you to make a video about websocket? how it works, how to use and ect.

ivan_adamovich
Автор

What would you do if you need the actual model in the job itself? Query it?

ryonnl
Автор

i dont understand if I send the USER to a job, Its serialised and saved in jobs table next to that job - when the job is run, why would LARAVEL make a new call to user table? surely it deserializes the saved user and works with that?

Shez-dcfn
Автор

But does this case apply to very large payloads?

For example, I created a job to store logs in the database, of course the logs will contain the information we need, and if it's a lot, won't passing it into parameters will only make the payload stored in the database fatter than we use serialize model?

budiprihhastomo
Автор

how about chunking so it does not run out of memory, most of the times this speed in sending email are not that much necessary, wdyt sir, thanks for your content

danjanuspineda
Автор

can u make a video about how to send email with email template support of CSS ????

iamriwash
Автор

is it better if we dispatch a job inside a loop?
or do the loop inside the job?

cykablyatii
Автор

Off topic question but, in your experience, how many requests can handle a Laravel API per second?

SLIMBOY
Автор

When will be published new course in teachable platforme ?

unitaxi