def update(d): # fire first t = tree.Tree(d) #print 'live', waiters.live_signals for key in [key for key in waiters.live_signals if tree.keyin(key, d)]: fd = {} for ks, x in t.find(key): fd[','.join(ks)] = x.value #print 'fire', key, fd waiters.send(key, fd) # update _tree.merge(d)
def update(d): lived = [key for key in waiters.live_signals if tree.keyin(key, d)] #print 'live', waiters.live_signals, lived for key in lived: fd = {} for ks, x in tree.query(d, key): fd[','.join(ks)] = x #print 'fire', key, fd waiters.send(key, fd) # update #print 'update:', d tree.merge(_tree, d) # need dump tree? global _last_update, _last_dump now = time.time() if _last_dump is None or now - _last_dump > dump_interval: tick_later() _last_update = time.time()