Single-Threaded thus Asynchronous
Multi-thread vs mono-thread
function processRequest(request) {
/*
* Pre-processing.
*/
var query = prepareQuery(...);
var result = execQuery(query); // might take few seconds...
/*
* Post-processing.
*/
var response = createResponse(result);
return response;
}Asynchronous processing using callbacks
Asynchronous processing advantages
Closures
Last updated