I'm using Redis's client python implementation from (the de facto standard): https://pypi.org/project/redis/
So I'm defining multiple workers in the background, and each worker has a connection instance created on startup:
class Worker(Process):
_db = None
def __init__(self):
super(Worker, self).__init__()
self._db = redis.Redis(host="1.2.3.4", port=1234, db=0)
However, whenever I try to start an instance of this worker, I get the following error message:
TypeError: can't pickle _thread.lock objects
So I'm guessing that this implementation uses a lock somewhere. What is the workaround for this issue?