Skip to content

refactor: remove abortable-iterator usage #1785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 5, 2023

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Jun 2, 2023

Closes #2001
Closes #2004
Closes #2020

@p-shahi
Copy link
Member

p-shahi commented Jun 6, 2023

Closing in favor of following this proposal: #1793

@p-shahi p-shahi closed this Jun 6, 2023
@wemeetagain
Copy link
Member Author

This should be reopened since we decided against using web streams

@wemeetagain wemeetagain reopened this Aug 24, 2023
@maschad
Copy link
Member

maschad commented Aug 29, 2023

This should be reopened since we decided against using web streams

I created a new issue to address this @wemeetagain

@wemeetagain wemeetagain force-pushed the chore/no-abortable-iterator branch from 7a1104f to bbb0742 Compare September 1, 2023 21:05
@wemeetagain wemeetagain requested a review from a team as a code owner September 1, 2023 21:05
@maschad maschad marked this pull request as draft September 4, 2023 14:27
@marcus-pousette
Copy link
Contributor

marcus-pousette commented Sep 4, 2023

I wonder whether a

const abortTimeout = setTimout(()=>abort(), someTimeout);

// if thing performed did complete succesfully

clearTimeout(abortTimeout)

if success approach would be cleaner if you just want to abort stuff that has not succeeded in a specific timeout.

This is much clearer also than adding and removing functions from an EventEmitter AbortSignal

@maschad maschad self-assigned this Sep 5, 2023
@maschad maschad marked this pull request as ready for review September 5, 2023 02:59
@achingbrain
Copy link
Member

I wonder whether a [setTimeout] approach would be cleaner

We had something similar to this previously via timeout-abort-controller but ultimately we switched it out because AbortSignal.timeout is built in so doesn't require an extra dep, and it also has the nice property of not keeping the nodejs event loop running like setTimeout does.

There's a non-zero cost associated with spawning loads of setTimeouts, though it'd be worth measuring to see how it compares to the same number of AbortSignal.timeouts.

@achingbrain achingbrain changed the title chore: remove abortable-iterator usage refactor: remove abortable-iterator usage Sep 5, 2023
@achingbrain achingbrain merged commit 2b755a8 into master Sep 5, 2023
@achingbrain achingbrain deleted the chore/no-abortable-iterator branch September 5, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
5 participants