-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-128307: add eager_start kwarg to asyncio.create_task #128306
base: main
Are you sure you want to change the base?
Conversation
graingert
commented
Dec 28, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: add start_eager parameter to asyncio.create_task #128307
c809133
to
2f101b3
Compare
task = self._task_factory(self, coro, context=context) | ||
|
||
task.set_name(name) | ||
task.set_name(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this set_name is too late because the task could have already run - so it needs a bit of thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can check first if the task factory exactly is eager_task_factory
, and call it with all provided arguments.
The last resort for unknown task factory could have flaws.
On the other side, we can use inspect.signature()
+ some form of cache to analyze in runtime what arguments are accepted. I'm not a big fan of this approach, but maybe we have not choice.
Support of third-party tasks and factories adds a mess; we should live with it.
Misc/NEWS.d/next/Library/2024-12-28-11-01-36.gh-issue-128307.BRCYTA.rst
Outdated
Show resolved
Hide resolved
|
yup, it's in I just forgot to add it to the news |