Skip to content

Instantly share code, notes, and snippets.

@cdax
Last active February 21, 2018 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdax/75eca6cbe8a29c3371b0c7d14700711c to your computer and use it in GitHub Desktop.
Save cdax/75eca6cbe8a29c3371b0c7d14700711c to your computer and use it in GitHub Desktop.
Controlled-Concurrency Queue example
<script src="https://github.com/grofers/ccq/releases/download/v0.1.0/ccq-0.1.0.min.js"></script>
<script>
new Queue()
.add(function(callback) { callback(null, 1); })
.add(function(callback) { callback(null, 2); })
.add(function(callback) { callback(null, 3); })
.await(function(results) { console.log(results); });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment