MCPcopy
hub / github.com/tornadoweb/tornado / worker

Function worker

demos/webspider/webspider.py:70–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 await q.put(new_url)
69
70 async def worker():
71 async for url in q:
72 if url is None:
73 return
74 try:
75 await fetch_url(url)
76 except Exception as e:
77 print(f"Exception: {e} {url}")
78 dead.add(url)
79 finally:
80 q.task_done()
81
82 await q.put(base_url)
83

Callers 2

test_task_doneMethod · 0.85
mainFunction · 0.85

Calls 3

fetch_urlFunction · 0.85
addMethod · 0.80
task_doneMethod · 0.80

Tested by 1

test_task_doneMethod · 0.68