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

async effects get prior task and interupt event #957

Closed
wants to merge 2 commits into from

Conversation

rmorshea
Copy link
Collaborator

async effects without arguments are now deprecated

Checklist

Please update this checklist as you complete each item:

  • Tests have been included for all bug fixes or added functionality.
  • The changelog.rst has been updated with any significant changes.
  • GitHub Issues which may be closed by this Pull Request have been linked.

async effects without arguments are now deprecated
@Archmonger
Copy link
Contributor

A lot of misspellings of interrupt

@rmorshea
Copy link
Collaborator Author

I'm leaning towards deprecating async effects at the moment. I don't think it's possible to defined async effects with a single function. Rather it would probably need to be more like:

effect = use_async_effect()

@effect.setup
async def my_effect_setup(): ...

@effect.teardown
async def my_effect_teardown(task): ...

This seems like a different enough interface that we might want to supply it in a separate package (at least initially).

@rmorshea rmorshea closed this Mar 21, 2023
@rmorshea rmorshea deleted the better-async-effects branch March 21, 2023 21:53
@Archmonger Archmonger linked an issue Apr 3, 2023 that may be closed by this pull request
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
2 participants