You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`concurrent`|`5`| How many tasks can be handled at the same time |
52
+
|`interval`|`500`| How often should new tasks be handled (in ms) |
53
+
|`start`|`true`| Whether we should automatically resolve new tasks as soon as they are added |
51
54
52
-
#### **public**`.enqueue(task)`/`.add(task)`
55
+
#### **public**`.enqueue(tasks)`/`.add(tasks)`
53
56
54
-
Puts a new task on the stack. Tasks should be an async function or return a promise. Throws an error if the provided `task` is not a valid function.
57
+
Puts a new task on the stack. A task should be an async function (ES2017) or return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Throws an error if the provided `task` is not a valid function.
Resolves _n_ concurrent promises from the queue. Uses global [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
75
+
Manually resolves _n_ concurrent (based od `options.concurrent`) promises from the queue. Uses global [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). Is called automatically if `options.start` is set to `true`. Emits `resolve` and `reject` events.
0 commit comments