Support providing AbortSignal to the `fs.stat` functions
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
What is the problem this feature will solve?
Currently fs.stat does not support providing an AbortSignal to fail-fast during teardown, unlike basically all other fs operations
What is the feature you are proposing to solve the problem?
That the StatOptions object have a new field signal?: AbortSignal and when that signal emits an "abort" event the underlying OS FS actions is aborted an the callback parameter of stat is called with an AbortError and undefined.
Futhermore, the async version of stat would also support this option but instead would reject the promise with an AbortError.
What alternatives have you considered?
None, this needs to be implemented within the VM
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 fs.stat 和 StatOptions 的入口点,然后比较现有 fs 操作如何接受 AbortSignal 并传播 AbortError。完成的标准是:基于回调的 stat 在中止后返回 AbortError 和 undefined,而基于 promise 的版本以 AbortError 拒绝,并且底层文件系统操作停止。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- backend-api-design, operating-systems
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100