I will explain my question with example.
fs.readFile('somefilename', function(err, data) {
...doSomething...
});
When this line of code is executed readFile
will start reading the file. On success or failure this callback will be pushed into queue for execution with appropriate arguments.
Reading of file is happening asynchronously
, but who's doing it if NodeJS is single threaded, non-blocking?