Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

queue-serializer.js 441B

12345678910111213141516171819
  1. var mod_vasync = require('../lib/vasync');
  2. var queue = mod_vasync.queue(function (task, callback) { task(callback); }, 1);
  3. queue.push(function (callback) {
  4. console.log('first task begins');
  5. setTimeout(function () {
  6. console.log('first task ends');
  7. callback();
  8. }, 500);
  9. });
  10. queue.push(function (callback) {
  11. console.log('second task begins');
  12. process.nextTick(function () {
  13. console.log('second task ends');
  14. callback();
  15. });
  16. });