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.

README.md 973B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Pend
  2. Dead-simple optimistic async helper.
  3. ## Usage
  4. ```js
  5. var Pend = require('pend');
  6. var pend = new Pend();
  7. pend.max = 10; // defaults to Infinity
  8. setTimeout(pend.hold(), 1000); // pend.wait will have to wait for this hold to finish
  9. pend.go(function(cb) {
  10. console.log("this function is immediately executed");
  11. setTimeout(function() {
  12. console.log("calling cb 1");
  13. cb();
  14. }, 500);
  15. });
  16. pend.go(function(cb) {
  17. console.log("this function is also immediately executed");
  18. setTimeout(function() {
  19. console.log("calling cb 2");
  20. cb();
  21. }, 1000);
  22. });
  23. pend.wait(function(err) {
  24. console.log("this is excuted when the first 2 have returned.");
  25. console.log("err is a possible error in the standard callback style.");
  26. });
  27. ```
  28. Output:
  29. ```
  30. this function is immediately executed
  31. this function is also immediately executed
  32. calling cb 1
  33. calling cb 2
  34. this is excuted when the first 2 have returned.
  35. err is a possible error in the standard callback style.
  36. ```