Name: thunk-queue
Owner: thunks
Description: Thunk queue for uncertainty tasks evaluation.
Created: 2015-03-20 11:59:36.0
Updated: 2018-04-11 07:24:37.0
Pushed: 2017-06-04 13:52:56.0
Size: 10
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Thunk queue for uncertainty tasks evaluation.
t thunkQueue = require('thunk-queue')
t queueT = thunkQueue()
eT(function(err, res) {
It is will be run after all thunkable task finished in queue.
nsole.log(err, res)
eT.push(1) // push a primitive value to queue
eT.push(Promise.resolve(1)) // push a promise to queue
ueueT.push(...), support all thunkable value, such as primitive value, thunk function, promise, generator object, generator function...
eT.end() // end the queue.
install thunk-queue
t thunkQueue = require('thunk-queue')
Return a thunk function with a closure queue.
t queueT = thunkQueue()
Push thunkable task to the thunk
's queue, thunkable task will be eager evaluated, return the queueT
;
End the thunk
's queue. the thunk
will be evaluated after all tasks finished in queue. return the queueT
;