New in Laravel 11: Concurrency

  Рет қаралды 11,677

Codecourse

Codecourse

Күн бұрын

Пікірлер: 22
@outsomnia
@outsomnia 2 ай бұрын
Very helpful. As a performance and the premature optimization freak I liked the part where you showed how unnecessary Concurrency calls caused larger memory usage and longer request durations.
@codecourse
@codecourse 2 ай бұрын
Yep, I made sure to include this because it’s so easy to get into the trap of using perf features like this without thinking! Glad you found this helpful.
@HumpaLumpaBiriBam
@HumpaLumpaBiriBam 2 ай бұрын
thank you for short & straight to the point tutorials
@codecourse
@codecourse 2 ай бұрын
My pleasure, glad they help!
@princejohnsantillan
@princejohnsantillan 2 ай бұрын
I'm curious to know why running them concurrently took longer.
@onessimuslyngdoh289
@onessimuslyngdoh289 2 ай бұрын
Probably because the tasks need to be serialised for processing and their results de-serialised. For light tasks, the serialisation and de-serialisation just add needless overhead
@codecourse
@codecourse 2 ай бұрын
Yep, correct. Thanks for responding! As mentioned in the course it’s not ideal for fast code execution that wouldn’t make much difference to the response time. I think the official docs show the example of generating a report, which is the kind of thing this would be much more suitable for.
@pawelabrams
@pawelabrams 2 ай бұрын
​@@onessimuslyngdoh289exactly, remember that serialization is done twice: closure is serialized on its way to artisan and deserialized there, then the result is serialized on artisan's side and deserialized in the web process. If you actually return the users to the endpoint, they would be serialized again, this time to JSON. Ideal task to send to background is one that has a defined, easy input (eg. one method call) and a defined short output (eg. filename), yet contains a lot to do in the meantime (eg. get data from two sources and mangle it together to create a PDF file with summary). Then only having _two or more_ of these together will gain you any perf improvements.
@jamessilvey5565
@jamessilvey5565 2 ай бұрын
Use PHP-FPM OR OCTANE Otherwise will not in artisan serve
@estabansenorbanana5355
@estabansenorbanana5355 2 ай бұрын
Great explaination, but the font spacing simply distracts me the entire time..
@codecourse
@codecourse 2 ай бұрын
Ah sorry about that!
@alanis4AL
@alanis4AL 2 ай бұрын
Thank you
@codecourse
@codecourse 2 ай бұрын
You're welcome!
@mdlimonrana8288
@mdlimonrana8288 2 ай бұрын
Is that possible to run api call inside this? I tried it but it’s not working
@codecourse
@codecourse 2 ай бұрын
I haven’t tried personally, but it wouldn’t surprise me if this didn’t work. Aside from that, it’s probably not the most suitable method of making an API call, best to just make the call normally.
@mdlimonrana8288
@mdlimonrana8288 2 ай бұрын
@@codecourse thanks for your reply. Actually I have tried to implement a feature, where I have to call 7 API call together for user api events testing. That’s why I thought that can be useful there. But unfortunately it didn’t works with that. That’s why I asked you about that.
@michaelbrevig
@michaelbrevig 2 ай бұрын
@@mdlimonrana8288 What exactly isn't working for you? Are one of your calls timing out? Does it work if you use sync as the driver? What error are you getting?
@codecourse
@codecourse 2 ай бұрын
@@mdlimonrana8288 Feel free to post over in the forum (codecourse.com/forum) if you don't figure this out, and I'd be happy to dive more into this there.
@pawelabrams
@pawelabrams 2 ай бұрын
Laravel docs state that the closure is serialized before it's sent to artisan... maybe the required variables are out of scope after the serialization process.
@fractal-tess
@fractal-tess 2 ай бұрын
promise.all? just how bad is php if this is not core?
New in Laravel 11: Skipping queued jobs
5:40
Codecourse
Рет қаралды 1,1 М.
Make faster outbound requests with Laravel (10x faster, actually)
5:28
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
New in Laravel 11: The defer() function
13:54
Codecourse
Рет қаралды 2,2 М.
4 Problems with Eloquent Soft Deletes (and Two Alternatives)
9:05
Laravel Daily
Рет қаралды 14 М.
Build AI Agents with PydanticAI & Riza
18:42
Riza, Inc.
Рет қаралды 4,4 М.
The Only Database Abstraction You Need | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 233 М.
Laravel + Service Pattern + DTOs = ❤️❤️❤️
17:52
Przemysław Przyłucki
Рет қаралды 54 М.
The Rust Survival Guide
12:34
Let's Get Rusty
Рет қаралды 174 М.
Let's talk about Events and Listeners
8:23
Laravel
Рет қаралды 7 М.
i dove down the 7z rabbit hole (it goes deep)
12:50
Low Level
Рет қаралды 587 М.
This is why understanding database concurrency control is important
9:05