Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1、优化多个客户端同时存在,curl事件统一循环,充分利用curl
2、promise resolve之后,立马加入curl循环,完全异步化。
比如:2个客户端,4个任务。
【客户端1】任务1需要8秒,
【客户端2】任务2需要4秒,
【客户端3】任务3依赖任务1结果需要2秒,
【客户端3】任务4依赖任务2结果需要5秒。
原来的流程会
运行任务1->运行任务2->multi运行任务3、4。耗时:8+4+5 = 17
优化1:
运行任务1、2->multi运行任务3、4。耗时:8+5 = 13
优化2:
运行任务1、2->任务2先完成,运行任务4->任务1完成,运行任务3。耗时:8+2 = 10