-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Make Timer(f, ...)
tasks match the stickiness of the parent task. Add spawn
kwarg.
#56745
Make Timer(f, ...)
tasks match the stickiness of the parent task. Add spawn
kwarg.
#56745
Conversation
Why is this a new option? Isn't spawning strictly better? |
In case there are use cases where code relies on the behavior. Maybe not needed? |
Sadly needed. |
Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com>
why is it needed? |
We should also look for uses of Timer and change them. I also think that this should change the default. Having spooky action at a distance be why someones code is working is not correct. The fact that we sticky is not documented anywhere. |
What about spawn if the parent task isn't sticky already? |
I'm proposing merging this as opt-in, but once the discussion above is settled, maybe it can still be made opt-out. |
I like this idea. |
Timer(f, ...)
tasks match the stickiness of the parent task. Add spawn
kwarg.
Now updated to this. |
Currently
Timer(f, 1)
will create a sticky task and have the same effect as@async
in making the parent task also sticky.I'm not sure if this should be treated as a bugfix (i.e. backport) or a minor behavior change (i.e. introduce in 1.12).
Or just an opt-in new feature, so
spawn=false
by default.Now matches parent task stickiness by default.