Skip to content

Better async effect shutdown behavior #1267

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

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Feb 3, 2025

Description

Asynchronous code is fundamentally tricky to handle, given issues with race conditions and task cancellation. This is significant to us since we currently support asynchronous effects within use_async_effect.

This PR attempts to alleviate some of those concerns by giving asynchronous effect functions a small amount of time (configurable) to finish executing before being forcibly shutdown.

Additionally, this PR refactors use_effect code to be human-readable.

Predecessor PR:

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

@Archmonger Archmonger changed the base branch from main to develop February 3, 2025 10:14
@Archmonger Archmonger marked this pull request as ready for review February 3, 2025 10:20
@Archmonger Archmonger merged commit 1a221c8 into reactive-python:develop Feb 3, 2025
17 checks passed
@Archmonger Archmonger deleted the v2-rewrite-use-async-effect branch February 3, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better Async Effect Cleanup
1 participant