We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I would like to be able to use the scheduler API to set and get task/job names. Something like so:
await scheduler.spawn(my_task(), name="my-task") await scheduler.spawn(another_task(), name="another-task") jobs = [job for job in scheduler._jobs] task_names = [job._task.get_name() for job in jobs]
task_names > ['my-task', 'another-task']
Even better would be delegating job.get_name() to job._task.get_name() so the final usage could be like:
job.get_name()
job._task.get_name()
job_names = [job.get_name() for job in scheduler._jobs]
job_names > ['my-task', 'another-task']
At the moment if I needed to get the task name I would have to use the following and I'd rather not access so many private variables if possible:
task_names = [job._coro.cr_code.co_name for job in scheduler._jobs]
The text was updated successfully, but these errors were encountered:
I think we could pass the name parameter to asyncio.create_task() somehow and then maybe add a helper method to also fetch the name.
name
asyncio.create_task()
Feel free to make a PR.
Sorry, something went wrong.
Thanks @Dreamsorcerer & @zoicsoftware for your time and effort
Successfully merging a pull request may close this issue.
Feature request:
I would like to be able to use the scheduler API to set and get task/job names. Something like so:
Proposed Usage
Output:
Bonus Usage
Even better would be delegating
job.get_name()
tojob._task.get_name()
so the final usage could be like:Output:
At the moment if I needed to get the task name I would have to use the following and I'd rather not access so many private variables if possible:
The text was updated successfully, but these errors were encountered: