sequential, threaded & async HTTP clients using HTTPX

This commit is contained in:
Luciano Ramalho 2021-10-02 17:48:34 -03:00
parent 6359a4de0c
commit 980f750326
2 changed files with 2 additions and 0 deletions

View File

@ -67,6 +67,7 @@ async def supervisor(cc_list: list[str],
to_do_iter = asyncio.as_completed(to_do) # <4>
if not verbose:
to_do_iter = tqdm.tqdm(to_do_iter, total=len(cc_list)) # <5>
error: httpx.HTTPError | None = None
for coro in to_do_iter: # <6>
try:
status = await coro # <7>

View File

@ -70,6 +70,7 @@ async def supervisor(cc_list: list[str],
to_do_iter = asyncio.as_completed(to_do) # <4>
if not verbose:
to_do_iter = tqdm.tqdm(to_do_iter, total=len(cc_list)) # <5>
error: httpx.HTTPError | None = None
for coro in to_do_iter: # <6>
try:
status = await coro # <7>