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-stat.js 529B

123456789101112131415161718192021
  1. var mod_fs = require('fs');
  2. var mod_vasync = require('../lib/vasync');
  3. var queue;
  4. function doneOne()
  5. {
  6. console.log('task completed; queue state:\n%s\n',
  7. JSON.stringify(queue, null, 4));
  8. }
  9. queue = mod_vasync.queue(mod_fs.stat, 2);
  10. console.log('initial queue state:\n%s\n', JSON.stringify(queue, null, 4));
  11. queue.push('/tmp/file1', doneOne);
  12. queue.push('/tmp/file2', doneOne);
  13. queue.push('/tmp/file3', doneOne);
  14. queue.push('/tmp/file4', doneOne);
  15. console.log('all tasks pushed:\n%s\n', JSON.stringify(queue, null, 4));