eggjs / eggjs/egg

使用 piscina 实现不阻塞的 runInBackground

Open
#5,359 0 comments 0 reactions 0 assignees View on GitHub
semver: major type: feature
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

### 请详细告知你的新解决思路(Your new RFCs):

https://github.com/piscinajs/piscina

目前的 runInBackground 是在 worker 进程或者 agent 进程执行的,如果是 cpu 密集型,那么还是会阻塞当前 worker 的处理速度下降。https://github.com/eggjs/egg/blob/ce4fd67278e008a0f58beff8db5c0f770f3eadc7/app/extend/context.js#L224

### 跟进类型(Follow-up Types):

- [ ] 这是某个任务
- [ ] 这是一个具体的 PR 的地址(URL)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.