Questions tagged [python-rq]

RQ is a simple, lightweight, Python library for creating background jobs, and processing them.

RQ (Redis Queue) is a simple library for queueing jobs and processing them in the background with workers. It is backed by and it is designed to have a low barrier to entry. It should be integrated in your web stack easily.

Resources

171 questions
8
votes
2 answers

python rq - how to trigger a job when multiple other jobs are finished? Multi job dependency work arround?

I have a nested job structure in my python redis queue. First the rncopy job is executed. Once this is finished the 3 dependant registration jobs follow. When the computation of all these 3 jobs is finished I want to trigger a job to send a…
florian
  • 604
  • 8
  • 31
8
votes
1 answer

How to correctly catch and process RQ timeouts in Python?

Trying to find a good way to catch a timeout of an RQ job, so it can be requeued after the timeout. Basically, the correct solution would provide a way (for example, an exception handler in the worker or something of the sort) to requeue the job…
Juan Carlos Coto
  • 11,900
  • 22
  • 62
  • 102
8
votes
6 answers

How to clear Django RQ jobs from a queue?

I feel a bit stupid for asking, but it doesn't appear to be in the documentation for RQ. I have a 'failed' queue with thousands of items in it and I want to clear it using the Django admin interface. The admin interface lists them and allows me to…
Joe
  • 46,419
  • 33
  • 155
  • 245
6
votes
1 answer

How to start a custom RQ worker within a Docker Container (Python, Flask and Redis)

I followed the excellent Flask Mega Tutorial by Miguel Grinberg and have successfully setup a Flask web app with a Redis task queue and RQ workers, all in Docker containers. To improve task queue performance, I now need to use my own custom worker,…
Robin Hartley
  • 91
  • 1
  • 8
6
votes
0 answers

Celery vs RQ benchmarking

Due to having trouble with the reliability and scheduling in celery we decided to evaluate alternatives. I have been struggling setup a benchmark between the two message queue solutions with regards to base performance. My current approach is to…
swartchris8
  • 620
  • 1
  • 6
  • 24
6
votes
0 answers

TypeError: cannot serialize '_io.TextIOWrapper' object- Flask

I am writing a flask app that asks user to upload excel spreadsheet and then calculate and populate the database.I am trying to do the processing part in the background via Redis RQ but I keep getting TypeError: cannot serialize '_io.TextIOWrapper'…
Rajin Dangol
  • 61
  • 1
  • 4
6
votes
2 answers

Python RQ: pattern for callback

I have now a big number of documents to process and am using Python RQ to parallelize the task. I would like a pipeline of work to be done as different operations is performed on each document. For example: A -> B -> C means pass the document to…
xiaohan2012
  • 9,870
  • 23
  • 67
  • 101
5
votes
0 answers

How to start multiple workers for only one of rq Queues?

I need to start multiple workers for only one of my queues (the "high" priority one below). How can I do this in the context of a worker script that I am using to start my workers? from config import Config from redis import from_url from rq import…
Anubhav
  • 545
  • 3
  • 14
5
votes
1 answer

How to create a ``depends_on`` relationship between scheduled and queued jobs in python-rq

I have a web service (Python 3.7, Flask 1.0.2) with a workflow consisting of 3 steps: Step 1: Submitting a remote compute job to a commercial queuing system (IBM's LSF) Step 2: Polling every 61 seconds for the remote compute job status (61 seconds…
ostpoller
  • 109
  • 8
5
votes
1 answer

Python / rq - How to pass information from the caller to the worker?

I want to use rq to run tasks on a separate worker to gather data from a measuring instrument. The end of the task will be signaled by a user pressing a button on a dash app. The problem is that the task itself does not know when to terminate since…
Doug P.
  • 133
  • 2
  • 12
5
votes
0 answers

What is the correct way to manage paths when using RQ workers, queues and jobs

My first question/post ... please be kind.... I am working on a personal project where one module runs in a loop gathering data. When data comes in, it hands off the insertion of the data into a database to a function on a queue where a listening rq…
StapleIT
  • 51
  • 4
5
votes
2 answers

Large memory Python background jobs

I am running a Flask server which loads data into a MongoDB database. Since there is a large amount of data, and this takes a long time, I want to do this via a background job. I am using Redis as the message broker and Python-rq to implement the…
WillJones
  • 907
  • 1
  • 9
  • 19
5
votes
1 answer

Enqueuing Instance Methods or Objects in RQ?

So, RQ explicitly states I can enqueue an instance method of an object here, so I've been trying to do that, but getting a PicklingError: q.enqueue(some_obj.some_func, some_data) *** PicklingError: Can't pickle : attribute lookup…
Eli
  • 36,793
  • 40
  • 144
  • 207
5
votes
1 answer

RQ concurrency with supervisord?

All, I'm attempting to 'force' RQ workers to perform concurrently using supervisord. My setup supervisord setup seems to work fine, as rq-dashboard is showing 3 workers, 3 PID's and 3 queue (one for each worker/PID). Supervisord setup is as follows…
GG_Python
  • 3,436
  • 5
  • 34
  • 46
5
votes
1 answer

How should I handle RQ workers for overlapping batch processes

I've started using RQ / Redis to build out some asynchronous execution of some long running jobs for my django site. I'm hoping to do something like the following: I want one queue for each instance of a model. You can think of this model like an…
RutledgePaulV
  • 2,568
  • 3
  • 24
  • 47
1
2
3
11 12