Your way of explaining is probably the best I've seen on RUclips. Your video on a certain concept pretty much leaves me with no questions to ask about it.
This comment made me smile. Yeah I try to set my videos apart by making them as simple as possible, ironically. Some other teachers I've seen on RUclips are REALLY smart and knowledgeable about programming topics but are lousy communicators so the overall message gets lost and the tutorial becomes of little value.
Wow this is a great tutorial. I have seen like 20 videos of you in last 2-3 hours, your explanations are super easy to understand. Can you please also make a video on use cases distinguishing web worker vs service worker and web scokets? I am confused which one to be used for what type of use cases?
What if you need web workers to do multiple tasks and in different js files, how will they distinguish between msgs they pass among themselves. Like there is no indication apart from where it's called an instance of worker can have different name, but inside worker.js file how will they distinguish between multiple functions (performing different tasks)
Great explainer video. Loved the way you demonstrated. For your next videos can I request some things I often confuse with "web workers"? Service workers Web sockets Web components
What the perfect explanation! Thank you for that! :) So technically said workers are calculated on a "virtual" threads of JS-engine, not on real CPU threads/cores?
Glad it helped! According to the Mozilla docs, workers are spawned using "real OS-level threads" developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#about_thread_safety
Great video thanks! that helped me to understand web workers for the first time. Could you please also make a video about promise, I still don't know if there is any background work going on with promises, or is await promise also being performed on the main thread, blocking it until the promise is finished?
I do have videos on Promises and also await/async. Yes when you await a Promise you're effectively blocking the main thread of execution until that promise resolves (or rejects)
Hi patrick, so web workers seems to be look like (async/await or promises) concept. eventually we defer specific task/s since it takes long time of response while in the same time we complete the other tasks so that we don't waste time in waiting. It is obvious that the main goal of these techniques is to control the outcome and performance of the application but I would like to see more details on the web workers and async/await concepts in real life example. Sync = Action A .. wait for the results of (A) Async = Action A .... wait for the results of (A) and keep doing other actions of (B), (C) and(D) This is how I understood Sync/Async/Web Workers .... Am I right ?
Hey man thanks for the tutorial. I am getting an error for Worker constructor when I use it like this. It is not defined for me. Also, if I use the new syntax where you put in url in the constructor like this: ``` new Worker(new URL('path'), import.meta.url) ``` I dont get any errors like this but in this case, when I specify the onmessage function in the worker script, self and onmessage are both undefined again. Any ideas?
💙 Twitter: twitter.com/realDevSage
📙 Ebooks: payhip.com/devsage
💥 Discord: discord.gg/BP8wPv6raA
👕 Merch: cottonbureau.com/people/devsage
Your way of explaining is probably the best I've seen on RUclips. Your video on a certain concept pretty much leaves me with no questions to ask about it.
This comment made me smile. Yeah I try to set my videos apart by making them as simple as possible, ironically. Some other teachers I've seen on RUclips are REALLY smart and knowledgeable about programming topics but are lousy communicators so the overall message gets lost and the tutorial becomes of little value.
I love your approach of explaining in a short consice and a simple manner. Thank you now I have an understanding of web workers. ❤️
You're very welcome!
I've never heard about web workers before, this is interesting, thank you so much.
You're welcome!
Thanks!
I really appreciate that Omar!
Wow this is a great tutorial. I have seen like 20 videos of you in last 2-3 hours, your explanations are super easy to understand. Can you please also make a video on use cases distinguishing web worker vs service worker and web scokets?
I am confused which one to be used for what type of use cases?
Feels lucky I discovered your channel
A lot of these videos have been super helpful! Good length, good explanations. Thanks dude! Keep it up!
Glad you like them!
What if you need web workers to do multiple tasks and in different js files, how will they distinguish between msgs they pass among themselves. Like there is no indication apart from where it's called an instance of worker can have different name, but inside worker.js file how will they distinguish between multiple functions (performing different tasks)
Thank you man, it was an intro of basics , but it was useful, it introduced me to the main concept of Web Worker API
No problem
this is so helpful especially for a beginner
Best explanation I've heard yet. I'm ready to code some workers now. 👍
Please do a video explain about service worker :) Great video by the way
I will put it on my radar
Yes, please!
Very clearly explained! Thank you for sharing.
You're welcome!
Simple, Short and Clean 👍👍👍
Thanks!
Great explainer video. Loved the way you demonstrated. For your next videos can I request some things I often confuse with "web workers"?
Service workers
Web sockets
Web components
Nice example demo. Works perfectly.
Very lucidly explained!! Thank you....
You're welcome!
great, I wonder if i can inject worker as code from server to hide my logic from public but still using client computation power
Short and to the point. Great explanation thanks man. new subscriber notification up.
Thank you for explaining this. It was very helpful!
Glad it was helpful!
you just earned yourself a subscriber. well done!
Good work man, it really helped
Glad it helped
Brilliantly explained, thank you!
Glad it was helpful!
So very well explained, thanks.
No problem
super awesome explanation, man 👍👏
how to use it in ReactJS project?
You Sir are a true hero. Thanks for this!
Amazing explanation man !!
Appreciate it!
What the perfect explanation! Thank you for that! :)
So technically said workers are calculated on a "virtual" threads of JS-engine, not on real CPU threads/cores?
Glad it helped! According to the Mozilla docs, workers are spawned using "real OS-level threads"
developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#about_thread_safety
@@DevSage that's nice to know it! Thank you for the reply :)
Simple and Perfect
Keep it up!!
Is it possible to pass the function and the params to the worker file and return the result ? So it can be versatile..
but what happen if I tell the worker to do some heavy stuff before it has finished previous heavy stuff?
That was sooooooooo clear and straight .
Thank you very much
You're welcome!
Nice job boy , Thank you so much 🌹
Yep - great stuff - subscribed.
Great explanation !
Thank you!
clear and informative with an example. Thank you so much.
Great video. Thanks a lot, man
You're welcome
Great video thanks! that helped me to understand web workers for the first time.
Could you please also make a video about promise, I still don't know if there is any background work going on with promises,
or is await promise also being performed on the main thread, blocking it until the promise is finished?
I do have videos on Promises and also await/async. Yes when you await a Promise you're effectively blocking the main thread of execution until that promise resolves (or rejects)
Hi patrick, so web workers seems to be look like (async/await or promises) concept. eventually we defer specific task/s since it takes long time of response while in the same time we complete the other tasks so that we don't waste time in waiting.
It is obvious that the main goal of these techniques is to control the outcome and performance of the application but I would like to see more details on the web workers and async/await concepts in real life example.
Sync = Action A .. wait for the results of (A)
Async = Action A .... wait for the results of (A) and keep doing other actions of (B), (C) and(D)
This is how I understood Sync/Async/Web Workers .... Am I right ?
Yes, the underlying idea is all the same. Synchronous work is "blocking" while asynchronous work is "non-blocking"
Thank you for your work!
My pleasure!
thank you so much for your sharing.
You're welcome!
i couldnt finish reading it but the first 2 sentences were inspirin LMAO
Awesome man 👍
Thanks
Thank you. Very well explained 👍
Hey man thanks for the tutorial. I am getting an error for Worker constructor when I use it like this. It is not defined for me. Also, if I use the new syntax where you put in url in the constructor like this:
```
new Worker(new URL('path'), import.meta.url)
```
I dont get any errors like this but in this case, when I specify the onmessage function in the worker script, self and onmessage are both undefined again. Any ideas?
The first parameter of the Worker constructor should be a string
@@DevSage it is a string :/
Great video
Thanks Caleb
great video thanks! :)
Solid example
can I use it in react?
Very helpful, thnx
No problem!
Awesome!!
Thanks!
Thank you!
Super cool
Thanks Mircea!
Thank you :)
nice explain
Thank you)
Not readable on smartphones :'-(
Nice
Classic
Great. And please stop repeating that javaScript is "single threaded" JavaScript is not single threaded. This is only confusing new comers.
So are you saying that the developers at Mozilla are incorrect? developer.mozilla.org/en-US/docs/Web/JavaScript
this is so helpful especially for a beginner
Great explanation!
Thanks!