Coordinate distributed systems.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
288 B

import time
from tooz import coordination
ALIVE_TIME = 5
coordinator = coordination.get_coordinator('memcached://localhost', b'host-1')
coordinator.start()
start = time.time()
while time.time() - start < ALIVE_TIME:
coordinator.heartbeat()
time.sleep(0.1)
coordinator.stop()