I have created a function in nodejs which return below object QueryName and Query
{"QueryName":"a","Query":"SELECT something from bar"}
{"QueryName":"b","Query":"SELECT something from bar"}
{"QueryName":"c","Query":"SELECT something from bar"}
{"QueryName":"d","Query":"SELECT something from bar"}
Also, i have created another function to get the query result.
Code is so far
executeQuery(connection, query, config.dbtype, response, function (error, data) {
});
function executeQuery(connection, query, dbtype, response, callback) {
DB_OPERATIONS.executeOperations(connection, APP_CONSTANT.findall, query, dbtype, null, null, "", function (error, data) {
callback(error, data);
});
};
FIND_ALL.findAllRecords(connection, query, dbtype, function(error, result) {
callback(error, result);
});
Time taking to execute each Query is 5 seconds, total time 20 Seconds.
How can i execute each query parallel in nodejs ?? thenafter instead of 20 seconds, maximum it will takes 5 seconds to get all queries data.