Skip to content

Commit a1f9547

Browse files
committed
Final unsync python web scraper.
1 parent 03ab1e7 commit a1f9547

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/py/ch10_async/ascrape.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ async def get_html(n: int) -> str:
2727
return resp.text
2828

2929

30+
# @unsync # <-- will run get_title_from_html() on a background thread.
31+
# @unsync(cpu_bound=True) # <-- will run get_title_from_html() on a subprocess.
3032
def get_title_from_html(n: int, html: str) -> str:
3133
print(Fore.CYAN + f"Getting TITLE for episode {n}...", flush=True)
3234

0 commit comments

Comments
 (0)