Question

I have a class that does a complex calculation for me. The actual calculation does not take that long, but getting an instance of the class takes about a second. (It reads in a bunch of large-ish data files.)

Is there a way that I can create an instance of this class, and then have my RQ worker re-use it, rather than having to re-initialize it for each job that I execute?

Was it helpful?

Solution

duh. I missed it in the documentation: http://python-rq.org/docs/workers/

Under "performance notes", it even gives sample code to help with this problem

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top