MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / gc_collect_until_done

Function gc_collect_until_done

test/test_pooling.py:49–58  ·  view source on GitHub ↗
(tasks, timeout=60)

Source from the content-addressed store, hash-verified

47
48
49def gc_collect_until_done(tasks, timeout=60):
50 start = time.time()
51 running = list(tasks)
52 while running:
53 assert (time.time() - start) < timeout, "Tasks timed out"
54 for t in running:
55 t.join(0.1)
56 if not t.is_alive():
57 running.remove(t)
58 gc.collect()
59
60
61class MongoTask(ConcurrentRunner):

Callers

nothing calls this directly

Calls 4

timeMethod · 0.80
joinMethod · 0.45
is_aliveMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected