摘要: 一个带并发限制的异步调度器,保证同时最多运行2个任务 class Scheduler { constructor(limit) { this.queue = [] this.limit = limit this.count = 0 } add(time, order) { const promise 阅读全文
posted @ 2022-01-19 11:10 xiao旭 阅读(271) 评论(0) 推荐(0) 编辑