node.js - How asynchronous functions work in nodejs internally -



node.js - How asynchronous functions work in nodejs internally -

i want understand, how asynchronous functions work in nodejs internally. suppose, want read file filesystem:

fs = require('fs') fs.readfile('/etc/hosts', 'utf8', function (err,data) { if (err) { homecoming console.log(err); } console.log(data); });

what going on, when phone call fs.readfile(...)? or, in words, how v8 interpreter interacts operating scheme (filesystem), when phone call fs.readfile(...)? how v8 knows, file reading done, , callback must called?

node.js asynchronous

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -