I\'m using a while loop in python:
def update_variable(): global myVariable while True: myVariable = db[\'key\'] time.sleep(.5)