Web Worker Tutorial | Understand The Benefits of Web Workers
HTML-код
- Опубликовано: 29 сен 2024
- In this video I demonstrate how to use javascript web workers. I also explain the benefit of using web workers and problem web workers are aiming to solve.
Get 1 on 1 mentorship!! ▶▶▶ www.codingwith...
I loved how you presented the problem first. You are a great teacher! Cheers from Brazil! =D
Best technique to explain something is comparision! Great!
so we can use asynchronous methods like promises, settimeout insted of webworker
Thanks Chaim
thanks alot
Amazing explanation!
Thanks heaps for this. Very succinct and well explained. One question, it seems like webworkers are an alternative to async/await, and promises. Are there any advantages to webworkers over the other two options, or any situations where webworkers are preferred?
I think I’m gonna make a video about this. Been getting this question a lot and it’s hard to answer in a comment
@@CodingWithChaim Whoa, this is definitely the fastest response I've ever gotten to a comment I've left. I'll make sure to check back on your channel for relevant videos :)
Chaim I really like your idea to illustrate the problem first. This is the crucial element missing from hunting and pecking through Stack for example, where you get solutions to somebody else's problems that are not like yours. Keep going and you will take off into the big time.
Very helpul video, very much informative. Thanks a lot for this
Can i use it with a that contain thousands of lines, ex 50 000 line ? THANK YOU
but what happen if I tell the worker to do some heavy stuff before it has finished previous heavy stuff?
Nice video. But I feel you speak a little too fast. Take your time.
Excellent man! very good video, thanks a lot
Hey, I saw this question online.
Web Workers define an API for:
A Publishing frequently updated works for syndication.
B Running scripts in the background,
C Bi-directional, full-duplex communications over a single TCP socket.
D Distributing load across multiple web servers.
They said the answer was A why is that? I thought the answer was B.
yea I agree with you A seems wrong. Can you link it?
hey, thanks for that video!
one question though
in minute 2:20 you show you activate an HTTP server and not explain about it, can you please explain how to work with it?
for me when I code with you on VS-Code without doing so the worker throws an error and when I run the same thing on visual studio it doesn't and the worker runs nicely
why is that?
ruclips.net/video/vnPemSnnJYY/видео.html
Wow! I didn't know about this. Thank you so much 🙏🏼
You are very welcome!
The Andrew Tate of Web Workers lol
Diference web worker vs asyc functions?
have you code on github?
coolest dev jew i've seen 😅
This is great! Such an easy explanation, can you make some tuts on rust and webassmebly with JS
Understood 100% of what he explained !!!!!
Very well expained!
Best explaination
Love You Brother : Please make a tutorial on web sockets : how they work with nodejs
so this is not directly websockets, but I do have a video about socket io. Here is the link ruclips.net/video/E4V6nbP_NoQ/видео.html let me know if you find this helpful
just awesome
I needed this
Best video
love you :)
Nice! I've seen the worker file in React but figured it was complicated so I just haven't looked into it. You just explained it great! Thanks!
I should point out that the worker file you might see in a Create React App, is actually not a web worker, but instead it is a service worker. They are vastly different. At some point I hope to make a video about service workers as well
Hmm
Kudos! This was very insighful and helpful. Great teacher, really simplified the content
thanks man i had no idea what these are.
You’re welcome! Yes these are really cool
I wished I'd known about this sooner. I made this web app a while ago that returns all the anagrams of a string, which there can a ton of with longer strings. A Worker looks like the ideal tool for this task.
Awesome I didnt know about this! keep making these awesome vids man!
Glad you enjoyed!
thank you mister lovely hat for the simple and good example
Perfect 👍
NICE explanation
thanks!
Hey, Chaim! Great video as always ! I've got a few questions: 1) What would a real life example be? (like some feature on an actual website) and can it be used in react ? P.S. Sorry if the questions are somewhat trivial. I'm relatively new to coding.
Great questions! One use case would be to parse large csv files in the browser. In fact there is a tool called papaParse which does exactly that, and it has the option to use a worker when the files are really large. Another example that I have personally run into, was in my file transfer video using webrtc. The idea was to be able to share really large files from one peer to other peer, now if the file was really large it had to get broken down into chunks and then get built back up as a blob on the other side. This process of building the chunks of file back into one blob had to be done in worker because if not the browser would freeze.
Also, yes this can absolutely be done in react.
@@CodingWithChaim , awesome, thanks a lot :)
Great video! I understand them much better now
Man! Nice work, easiest explanation. 5 stars :)
Learnt something new! :) Very nice content, btw. Keep up the good work. RUclips is a long term game. ;)
Thank you! I appreciate it
this is super-cool - had no idea this existed - thanks!
Great, concise explanation. Thank you!
@Coding With Chiam But what if we write that long taking functionality inside the setTimeout function? Will it also block the main thread? Could you please explain? Or maybe make another video with the explanation the difference between web workers and setTimeout(asynchronous functions). Don't they solve the same problem? Thanks
See this SO post stackoverflow.com/questions/50737037/settimeout-vs-web-worker-when-to-use-what#:~:text=They%20don't.,and%20is%20just%20as%20blocking.
@@CodingWithChaim Thank you
Thank you so much!