feat(async/unstable): add support for AbortSignal in pooledMap#7014
feat(async/unstable): add support for AbortSignal in pooledMap#7014tomas-zijdemans wants to merge 10 commits into
pooledMap#7014Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7014 +/- ##
=======================================
Coverage 94.57% 94.58%
=======================================
Files 636 637 +1
Lines 52138 52232 +94
Branches 9399 9426 +27
=======================================
+ Hits 49311 49404 +93
Misses 2249 2249
- Partials 578 579 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Ok. Now this works, but also it is something new to std (No API in std is overloaded in this way as far as I'm aware, and is something not covered by the styled guide). I'd like to here the opinions from other community members |
fibibot
left a comment
There was a problem hiding this comment.
CI green across all platforms. Code reads correctly: signal?.throwIfAborted() at the top of the for await loop prevents new items from starting, and Promise.allSettled(executing) in the outer catch lets in-flight items finish before the abort error propagates — matches the documented "currently executing items are allowed to finish" contract.
- nit: in the
TransformStream.transformcatch,controller.error(e as unknown);eis already typedunknownunder strict mode, drop the cast. - nit:
@throwsJSDoc only listsRangeError, but the iterator can also reject withsignal.reason(abort) orAggregateError(iteratorFnfailures) — worth documenting on the options overload.
… cast Address review nits on `pooledMap` options overload: expand the JSDoc to mention that the returned iterator rejects with `options.signal.reason` on abort or with an `AggregateError` of `iteratorFn` rejections, and drop the unnecessary `as unknown` cast since `e` is already typed `unknown` under strict catch typing. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @fibibot . The two nits are fixed. |
No description provided.