Comments (9)
I don't think there is, but in my scenario which sounds similar I just make a reserve request for the tube with a short timeout and check the return. If I get a TIMED_OUT response it means it was empty. I suppose you could peek, but then you would be looping.
from beaneater.
and how do you handle buried jobs? I suppose you should kick them all before declaring the tube empty when you get a TIMED_OUT response.
from beaneater.
I don't have buried jobs in my scenario, but a peek-buried or a kick on TIMED_OUT makes sense.
from beaneater.
I "solved" by creating a queue that monitors other queues. A bit "meta", but it works :)
from beaneater.
Yes, but do you have a queue to monitor the monitor queue? :)
from beaneater.
queue monitor is always there. if the monitored queue is empty the task gets archived, otherwise recreated with the same params and some delay.
from beaneater.
Stumbled upon a nasty situation. Monitor task detects a queue is empty and starts a very long upload task. I assume this will not be called anymore and it's the last operation to be performed on the queue, but for some reason a worker sometimes kicks in on exactly the same task I am performing (the upload) and starts to upload the same file again. Any hint?
from beaneater.
Uhm, I am gonna try to increase the ttr to 1800 and see how it goes.
from beaneater.
Ok, increasing a lot the ttr worked but I had to use a pretty complex if to make sure the queue is really not empty
if tube.stats.current_jobs_urgent > 0 || tube.stats.current_jobs_ready > 0 || tube.stats.current_jobs_reserved > 0 || tube.stats.current_jobs_delayed > 0 || tube.stats.current_jobs_buried > 0 || tube.stats.current_using > 0
Just peeking :ready, :buried and :delayed does not work for me.
from beaneater.
Related Issues (20)
- Initial example in documentation is wrong HOT 1
- Do you provide methods for testing worker? HOT 2
- jobs are not reserved but the tube is being watched HOT 2
- Rails 4.2 Active Job Adapter HOT 2
- Job is nil when burying HOT 1
- Automated processing and signal handling
- Beaneater.new requires one argument HOT 3
- How to gracefully stop a worker HOT 2
- Get Number of Ready Jobs Enqueued into a Tube HOT 1
- Duplicate jobs in the queue
- Process! is not propagating Beaneater::NotConnected exception. HOT 1
- Beaneater::Jobs#process shouldn't rescue StandardError
- Segmentation faults
- # different job_serializer/job_parser function by tube
- ENV['BEANSTALKD_URL'] not working? HOT 1
- ENV for the URL :: not working?
- Using Hash#slice forces ruby 2.5+ HOT 4
- Weighted queues HOT 1
- using colon in one parameter causes a weird replacement by underscores HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beaneater.