allow for Job class to have an __await__ method #512
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I thought it would be a smart idea if the Job class could be something that could be optionally awaited on simply by just calling await in cases were code such as
await job.wait()
is not feasible and where we know in advance that we don't need a timeout variable inplace, this would allow for something such asasyncio.gather()
to be easily done on a group of jobs to being awaited on rather than having to write a bunch of coroutines beforehand. This would make the job class more task-like since asyncio tasks have this same feature where they can be awaited simply by callingawait task
for instance. I have also written some unittests as well to for this library that would best demonstrate these examples.Related issue number
I don't think this is related to any issues however I do believe that this idea would be helpful.
Checklist