Distributed Synchronization for Python¶
Introduction¶
Tutti provides synchronization primitives that let you keep distributed systems synchronized. The API mirrors that of the
synchronization primitives in the builtin threading
module. It currently ships with a Redis backend,
but more providers are in the works.
Installing Tutti¶
You can install the latest version of tutti using pip
$ pip install tutti
Redis Configuration¶
You’ll need to have a redis instance somewhere, by default it looks for an instance running on the local machine, but the
connection can be configured using environment variables: TUTTI_REDIS_HOST
, TUTTI_REDIS_PORT
, TUTTI_REDIS_DB
Getting Started¶
from tutti import Lock, Semaphore
with Lock():
print("Synchronized across machines!")
access_critical_resource()
with Semaphore(value=2):
print("Semaphores too!")
access_less_critical_resource()
Roadmap¶
asyncio
synchronization primitives (asyncio.Lock
,asyncio.Semaphore
, etc)AWS/Azure service backends