-
Notifications
You must be signed in to change notification settings - Fork 16
/
p-limit.node.txt
17 lines (12 loc) · 1.67 KB
/
p-limit.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
P-LIMIT
VERSION ==> #4.0.0
P-LIMIT(NUM) #Returns FUNC() throttled to only run NUM times at once.
->FUNC(FUNC2, ...ARGS) #FUNC(FUNC2, ...ARGS) forwards FUNC2(...ARGS):
->PROMISE # - async even if FUNC2 is sync
# - FUNC2 and ...ARGS can be different each time FUNC() is called
#Additional calls are queued, not dropped.
FUNC.activeCount #NUM currently running
FUNC.pendingCount #NUM waiting to run
FUNC.clearQueue() #Removes any FUNC2 currently waiting to run