q_stack

Stack work for promises based on 'q' to prevent to much calls

Usage no npm install needed!

<script type="module">
  import qStack from 'https://cdn.skypack.dev/q_stack';
</script>

README

Q Stack,

is a simple library to handle a lot of calls. The idea is to put some functions on a stack and execute one after another using promises. Q_Stack requires: Q and underscore-node

Just a simple sample:

// Defines that maximal 5 function can be executed paralllel on the "SampleStack" Stack q_stack.maxCalls(5, "SampleStack");

// Put a function on the "SampleStack" to execute it with the arguments args1, args q_stack.call(function () { //do something }, ["arg1", "arg2"], "SampleStack");

By default the "default" Stack is set to maxium 10 parallel executed functions.

To change the maximum default: q_stack.maxCalls(9);

To execute something on default stack: q_stack.call(function () { //do something }, ["arg1", "arg2"]);