I haven't used redis in awhile and I'm porting pretty much all of my shared memory item code (aside from queues) in python multiprocessing to using a redis cache, and I needed to re-implement my locks.
I found this answer here: https://stackoverflow.com/a/20182448/3467349 - which suggests using brpop
as a lock.
But this won't work if it's not possible to pre-instantiate all of the necessary lists. Is there a special way to distinguish nil
on a non-existent key and nil
?