-
Notifications
You must be signed in to change notification settings - Fork 152
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
Allow for transient processing of jobs #191
Comments
As I alluded in a tweet, you can almost do this today. worker = QC::Worker.new
QC.count.times {woerker.work} The problem is that I think it would be nice if Thoughts? |
That solves the problem, though it requires a small bit of knowledge about the internals of QC. I guess it's nothing to wrap your code snippet in a rake task or some other helper method, though. |
Great point. If we had the right primitives, we could easily wrap them up into a QC provided Rake task. |
+1 from me. Perhaps we need some kind of a lock mechanism to prevent other workers from doing work while the queue is emptied? (the case that @ryandotsmith described). |
👍 would be nice to have this. @rwdaigle are you interested in working on a patch? |
@senny I'll put it on my list, but suspect it will not be in the near term that I'll be able to work on it. |
This provides a way to work off all the jobs in the queue and exit afterwards. Closes #191.
It would be convenient to have a single entry point into QC that processes all jobs, then exits (i.e. a non-daemon based worker). Something resembling:
or perhaps a new rake task all together?
The use case here is to reduce the need to have a long-lived daemon to keep alive for systems with low numbers of jobs, or jobs that can wait for a cron-based process to spawn and work on them. On Heroku this would allow users to have an hourly task with Scheduler to process the queue instead of a whole worker dyno.
The text was updated successfully, but these errors were encountered: