Skip to content

async effects get prior task and interupt event - #957

Closed
rmorshea wants to merge 2 commits into
mainfrom
better-async-effects
Closed

rmorshea wants to merge 2 commits into
mainfrom
better-async-effects

Conversation

@rmorshea

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

A lot of misspellings of interrupt

@rmorshea

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