Skip to content

refactor: remove abortable-iterator usage#1785

Merged
achingbrain merged 7 commits into
masterfrom
chore/no-abortable-iterator
Sep 5, 2023
Merged

refactor: remove abortable-iterator usage#1785
achingbrain merged 7 commits into
masterfrom
chore/no-abortable-iterator

Conversation

@wemeetagain

@wemeetagain wemeetagain commented Jun 2, 2023

Copy link
Copy Markdown
Member

Closes #2001
Closes #2004
Closes #2020

@p-shahi

p-shahi commented Jun 6, 2023

Copy link
Copy Markdown
Member

Closing in favor of following this proposal: #1793

@p-shahi p-shahi closed this Jun 6, 2023
@wemeetagain

Copy link
Copy Markdown
Member Author

This should be reopened since we decided against using web streams

@wemeetagain wemeetagain reopened this Aug 24, 2023
@maschad

maschad commented Aug 29, 2023

Copy link
Copy Markdown
Member

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

marcus-pousette commented Sep 4, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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