oleiade / py-elevator

py-elevator is a python client for Elevator, a Key-Value store written in Python and based on levelDB, allows high performance on-disk bulk read/write.
https://py-elevator.readthedocs.org/en/latest/
MIT License
13 stars 6 forks source link

Add locking to ensure thread-safety. Fix #44 #49

Closed k4nar closed 9 years ago

k4nar commented 10 years ago

I used a simple lock in Client.send. I'm not a big fan of locks, but it works like a charm and I don't see how we could do better.

If performances matter, we could use several sockets with a lock for each and select a random one in Client.send. But I'll keep that for another time.

Maybe we could have add simple test for that ?