Skip to content
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

refactor(experimental): make abort signals mandatory in subscriptions #1640

Conversation

steveluscher
Copy link
Collaborator

Summary

OK listen. We're all adults here. That being said, not having a strategy for cancelling your RPC subscriptions makes everything really complicated and leaves your code prone to leaks.

AbortSignal is now a mandatory argument to subscribe().

If you really want to launch your subscriptions without any cancellation strategy you can still do this:

rpc
  .slotNotifications()
  .subscribe({ abortSignal: new AbortController().signal });

We won't judge you.

Test Plan

pnpm turbo test:typecheck

Copy link
Contributor

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

discipline

@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from 9e008fd to d9d004b Compare September 29, 2023 21:37
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from 40b745e to e3fbbcf Compare September 29, 2023 21:37
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from d9d004b to 679b719 Compare September 29, 2023 22:45
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from e3fbbcf to b0b7086 Compare September 29, 2023 22:45
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from 679b719 to d4fd0cc Compare September 29, 2023 22:51
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from b0b7086 to 7ea1c8d Compare September 29, 2023 22:51
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from d4fd0cc to e8a1183 Compare September 29, 2023 23:13
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from 7ea1c8d to dbe3e48 Compare September 29, 2023 23:13
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from e8a1183 to d838c45 Compare September 29, 2023 23:27
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from dbe3e48 to 24494cb Compare September 29, 2023 23:27
@steveluscher steveluscher force-pushed the 09-29-test_fix_tests_forward_for_1.16.x branch from d838c45 to c72a627 Compare September 29, 2023 23:34
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from 24494cb to 063af49 Compare September 29, 2023 23:34
Base automatically changed from 09-29-test_fix_tests_forward_for_1.16.x to master September 30, 2023 00:00
@steveluscher steveluscher force-pushed the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch from 063af49 to 7f4ee8c Compare September 30, 2023 00:22
@steveluscher steveluscher merged commit 8f006a8 into master Sep 30, 2023
6 checks passed
@steveluscher steveluscher deleted the 09-29-refactor_experimental_make_abort_signals_mandatory_in_subscriptions branch September 30, 2023 00:26
@steveluscher
Copy link
Collaborator Author

Merge Activity

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

🎉 This PR is included in version 1.78.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants