MCPcopy Index your code
hub / github.com/course-dasheng/fe-algorithm / push

Function push

interview/limit.js:28–34  ·  view source on GitHub ↗
(fn,resolve,args)

Source from the content-addressed store, hash-verified

26 next() //下一个
27 }
28 const push = async (fn,resolve,args)=>{
29 queue.push(run.bind(null,fn,resolve,args))
30 if(activeCount<maxCount && queue.length>0){
31 // 队列没满 并且还有任务 启动任务
32 queue.shift()()
33 }
34 }
35
36 let runner = (fn,...args)=>{
37 return new Promise((resolve)=>{

Callers 1

runnerFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected