'Trigger the timeout on a given generator.'

def trigger(self, generator):

    try:
        generator.throw(self)
    except StopIteration:
        return True
    else:
        generator.close()
        return False
