Skip to content

feat(async/unstable): add support for AbortSignal in pooledMap#7014

Open
tomas-zijdemans wants to merge 10 commits into
denoland:mainfrom
tomas-zijdemans:pool-signal
Open

feat(async/unstable): add support for AbortSignal in pooledMap#7014
tomas-zijdemans wants to merge 10 commits into
denoland:mainfrom
tomas-zijdemans:pool-signal

Conversation

@tomas-zijdemans

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Feb 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.93617% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.58%. Comparing base (f0c9f14) to head (40e860d).

Files with missing lines Patch % Lines
async/unstable_pool.ts 98.93% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread async/unstable_pool.ts
@kt3k

kt3k commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

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 fibibot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.transform catch, controller.error(e as unknown); e is already typed unknown under strict mode, drop the cast.
  • nit: @throws JSDoc only lists RangeError, but the iterator can also reject with signal.reason (abort) or AggregateError (iteratorFn failures) — worth documenting on the options overload.

tomas-zijdemans and others added 2 commits May 26, 2026 19:30
… 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>
@tomas-zijdemans

Copy link
Copy Markdown
Contributor Author

Thanks @fibibot . The two nits are fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants