I have a use case which requires placing two different types of jobs in a beanstalk queue, say type a and type b. I put type a job whenever a new one arrives, but for type b I want that there should be a single job of type b in a queue at a time (there should never be two or more jobs of type b in queue). When I go for inserting type b job in queue, I first want to check if there is any type b job already in queue? If it is, then delay that job and don't insert a new one. If there is no type b job in queue, insert a new one. So is it possible to search a job in beanstalk queue?
1
There are 1 best solutions below
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in BEANSTALKD
- Install and run beanstalkd on Raspbian Bookworm with other processes
- Queue worker freezes unexpectedly and requires restart work work again
- Exception when using Pheanstalk lib to put new data on Beanstalkd
- Laravel Workers - AWS Beanstalkd Instance Termination
- pda/pheanstalk/src/Socket/StreamFunctions.php fwrite(): send of 219 bytes failed with errno=32 Broken pipe
- Clear beanstalk queue (laravel)
- PHP Message Queue for low volume jobs
- Can we migrate local beanstalkd to GCP Compute instance?
- Unexpected supervisor processes limitation
- Pheanstalk responds BAD_FORMAT
- Is converting byte slice to context possible?
- Explain output of tail [tube] from beanstool (beanstalkd)
- How to consume from beanstalk tube
- Remove delay in Laravel Queue
- How to configure beanstalkd to work with laravel Cache?
Related Questions in BEANSTALKC
- How to consume from beanstalk tube
- How to tell a beanstalkc receiver to wait X seconds before reserving a task?
- how to use callback in beanstalkd ?
- How to use callbacks with beanstalkc and beanstalkd
- When I use the 'reserve' operation in beanstalked, it is blocked for a long time
- Change beanstalkd default TTR
- Connection refused in Django_beanstalkd
- Search in beanstalk queue
- Non-Blocking WebSocketHandler while receiving jobs from a queue
- Reload beanstalkd configuration without restaring
- Getting jobs from beanstalkd - timed out exception
- Check if all reserved jobs have been completed using beanstalkc
- Beanstalkc Timeout Question
- How to use beanstalkc in Python to queue URLs and perform jobs
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No, you can't search a queue (Beanstalkd calls them 'tubes'), only get a job (though you can PEEK, to see what the next job would be).
Since you can watch more than one tube at a time though (and get a job from any one of them, depending on priority and age), you could create a tube that would only every contain a type-b job. Then it turns into a simple count - stats-tube [tube-name(eg 'type-b-jobs')]. If that tube has a job in it, it's a typ-b job, and so you can go on with the type-a jobs.