import threading
from concurrent.futures import ThreadPoolExecutor
import time
from tqdm_multi_thread import TqdmMultiThreadFactory
defdemo(factory, position, total):
with factory.create(position, total) as progress:
for _ inrange(0, total, 5):
progress.update(5)
time.sleep(0.001* (position %5+1))
with ThreadPoolExecutor(max_workers=20) as executor:
tasks =range(100)
multi_thread_factory = TqdmMultiThreadFactory()
for i, url inenumerate(tasks, 1):
executor.submit(demo, multi_thread_factory, i, 100)
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.