Exemple #1
0
        sleep = self.next_time - now
        if sleep > 0:
            time.sleep(sleep)
        self.next_time = now + self.delay


delayer = Delayer(1)
quick = False
while 1:
    if quick:
        print('---')
        quick = False
    else:
        delayer. await ()
        print("===")
        small_pool.allow_shrink = large_pool.actual >= large_pool.desired
        large_pool.allow_shrink = small_pool.actual >= small_pool.desired
        large_pool.poll()
        small_pool.poll()

    print_pool(large_pool)
    print()
    print_pool(small_pool)
    print()
    minions_with_claims = []
    if any(CLAIMS.values()):
        print("Claims:", end="")
        for i, (name, claims) in enumerate(sorted(CLAIMS.items())):
            if not claims:
                continue
            minions_with_claims.append(name)