Does node run on multiple threads? I guess reading a file can run on a thread. But how would node know it can safely run two different user functions in separate threads?
Comparing spawn and exec and saying spawn is better because you get a stream instead of a buffer. What is a stream if not a buffer? These are all shared memory were one program is writting info to be consumed by the other. Piping in a shell uses buffers
While I don't know the answer for sure as I'm still learning Node myself I would have to guess that the difference is something like this: a Stream uses a fixed size buffer and continuously writes data to it, flushes, and then writes more data. A Buffer can be arbitrarily large and attempt to read all or as much of the data at once. So if you're reading 2GB of data total, using Streams will use very little memory to complete the full read operation by reading it in chunks of a fixed amount. However, with Buffers you may end up creating a Buffer of 2GB which is too much memory to hand over to a program that is simply reading data.
@@kavan1773 buffer/stream are real world analogies to give a vibrant picture. They both refer to the same technique of allocating memory, and writing to it in batches, instead of fully allocating everything. As i said piping in a shell uses buffers. A webserver uses buffers. A streaming server like Kafka uses buffer. Anything networking does. You can call it streaming and it's equally valid. Video streaming is using buffer. It's sometimes tells you it's buffering for instance. It's one and the same
The speaker said that when the call stack and event queue are both empty, the node process exits. In case of http servers created using node, how exactly is the server is kept alive when we don't have any incoming requests at a given point of time?
Before the video began: WTF do you mean I don't know nodejs ... 5 minutes after watch the video... holy crap I did not know nodejs ..
I'm only 11min in but I'm safe to say this is the best ES talk I've watched so far. Big thanks for sharing
seriously, genius talk. Dude, you are awesome!
I knew the answers to about 70% of these questions, I'm so proud of myself!
Loving this talk... Watched it till 12:24.
Will come back and watch the whole thing
this guy is a genius,
I took his course on plural sight and it was awesome
please share the course name
@@namanjindal3089 Nodejs by Samir Buna,
It was quite a while ago, so I don't remember much
Thanks to Samer Buna
Me "I'm kind of a node expert" Samer "Hold my beer!"
This is just super cool. Thanks!
superb video i ever watched
8:08 export is an object reference for the module.
One of the BEST EVER, thank you
Brilliant Talk. I really didn't know node :D
YES, that's a really good presentation!
Very good and helpful talk! Thank you!
Clear explanation TQ very much
Very good talk
this guy is genius .
Kudos man, good talk
Best tips ever. Thanks
Amazing guy! :)
Does node run on multiple threads? I guess reading a file can run on a thread. But how would node know it can safely run two different user functions in separate threads?
by default it is single-threaded. there are ways for you to make it multi-threaded.
Ask your neighbor
Comparing spawn and exec and saying spawn is better because you get a stream instead of a buffer. What is a stream if not a buffer? These are all shared memory were one program is writting info to be consumed by the other. Piping in a shell uses buffers
While I don't know the answer for sure as I'm still learning Node myself I would have to guess that the difference is something like this: a Stream uses a fixed size buffer and continuously writes data to it, flushes, and then writes more data. A Buffer can be arbitrarily large and attempt to read all or as much of the data at once. So if you're reading 2GB of data total, using Streams will use very little memory to complete the full read operation by reading it in chunks of a fixed amount. However, with Buffers you may end up creating a Buffer of 2GB which is too much memory to hand over to a program that is simply reading data.
@@kavan1773 buffer/stream are real world analogies to give a vibrant picture. They both refer to the same technique of allocating memory, and writing to it in batches, instead of fully allocating everything. As i said piping in a shell uses buffers. A webserver uses buffers. A streaming server like Kafka uses buffer. Anything networking does. You can call it streaming and it's equally valid. Video streaming is using buffer. It's sometimes tells you it's buffering for instance. It's one and the same
perfect
10/10
The speaker said that when the call stack and event queue are both empty, the node process exits. In case of http servers created using node, how exactly is the server is kept alive when we don't have any incoming requests at a given point of time?
Qais Makani as he stated immediately after... you set a process to keep it alive
because it's not the requests that's keeping the process alive, it's the listening to the port that does.
The process of listening keeps the application alive
Idle
omg so now i understood why we do server.listen,
The more I learn about Node the more I start moving towards golang