'Redis enqueue error error in enqueue_operation can't pickle _thread.lock objects
I am using Redis queue for processing in queues:
redis_conn = redis.Redis()
redis_queue = Queue(connection=redis_conn, name="mainqueue")
job = redis_queue.enqueue(f=compute.dofactorial, args=[number],result_ttl=1000)
if the dofactorial is a instance method then I get this can't pickle error, if I
convert it to static Method, it works fine. Is there any solution for enqueuing
instance methods in Redis queue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
