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
Fix watchdog & scheduler #1757
Fix watchdog & scheduler #1757
Conversation
supervisor/misc/scheduler.py
Outdated
if not self.suspend: | ||
self.loop.create_task(data[CALL]()) | ||
if self.sys_core.state == CoreStates.RUNNING: | ||
self.sys_loop.create_task(data[CALL]()) |
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.
Is the context unspecific here, so we need to specify what loop to use when creating the task, ie use loop.create_task
instead of asyncio.create_task
?
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.
It's sys_create_task
. asyncio.create_task has more overhead which we can avoid anyway with our structure they we created before with python 3.4
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.
Ok. In the long run I think it's wise to try to move to the recommended higher level APIs. This is a trend in asyncio.
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.
Sure, I wait for executor/callback pool to have a high-level API and we can migrate once all to it. maybe with Python 4 - anyway there are ~53 bigger tasks on ClickUp
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.
Looks good (with my limited insight in the library)!
No description provided.