def process_changes():
    for change in database.get_changes():
        process_change(change)
        
register_with_mainloop(process_changes)