Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

terminator.js 533B

1234567891011121314151617181920212223242526272829
  1. var abort = require('./abort.js')
  2. , async = require('./async.js')
  3. ;
  4. // API
  5. module.exports = terminator;
  6. /**
  7. * Terminates jobs in the attached state context
  8. *
  9. * @this AsyncKitState#
  10. * @param {function} callback - final callback to invoke after termination
  11. */
  12. function terminator(callback)
  13. {
  14. if (!Object.keys(this.jobs).length)
  15. {
  16. return;
  17. }
  18. // fast forward iteration index
  19. this.index = this.size;
  20. // abort jobs
  21. abort(this);
  22. // send back results we have so far
  23. async(callback)(null, this.results);
  24. }