I'm currently trying to wrap my head around Node threads. I think I have an idea, but I'm not sure. I am puzzled by this quote from Dominic Tarr :
Streams are the best and most misunderstood idea of nodes, [...]
As Dominic is definitely a very smart guy (and I think smarter than me), I'm not sure if I understood the flows correctly, or if I missed the point ;-). Therefore, I would like to explain how I understood the flows and asked you for approval or rejection.
My basic understanding of streams is that streams are an abstract wrapper for transferring data from source to target. There are readable and writable streams, as well as a duplex stream that can be read and written. The idea is to abstract away the actual source or target so that you can focus on working with streams without having to know which actual resource you are dealing with. You simply access the stream for reading and / or writing.
Is my understanding of the correct Node.js threads? Basically, this is the same idea as threads in .NET (which has been my background for the last 12 years or so). How are Node.js threads different from threads in .NET?
To give an example: it doesn’t matter if I want to read from a file or a network resource, I simply abstract the actual source with the stream and then read from this stream. I could even change the source, but my stream reader code will still work the exact same way. Is it correct?
Golo roden
source share