-
Notifications
You must be signed in to change notification settings - Fork 69
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
Graceful shutdowns via Scheduler.wait() #48
Comments
This is a feature I want too, it is a base feature in my AntNest, I will not recreate wheel if aiojobs can provide this |
There are design questions:
|
In my opinion, the
|
But, I think a If anyone wants to implement this, I'll happily take a look at this. |
I'm writing an app that requires a few background jobs to fetch requests from a queue and process them atomically.
When the main app receives a shutdown signal, I'm firing an
asyncio.Event
to let the jobs know they need to close after they finish processing the task, and I thenJob.wait()
each of them.It would be more convenient to do this via the
Scheduler
class. Currently it only has support forclose()
ing all the jobs, but not forwait()
ing them. Does it make sense to add such a function? A simplified version would look like this:The text was updated successfully, but these errors were encountered: