'Runs callback(arg) after a number of IOLoop iterations.'

def delay_callback(self, iterations, callback, arg):

    if (iterations == 0):
        callback(arg)
    else:
        self.io_loop.add_callback(functools.partial(self.delay_callback, (iterations - 1), callback, arg))
