MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / async_wrapper

Function async_wrapper

botasaurus/browser_decorator.py:340–349  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

338
339 @wraps(func)
340 def async_wrapper(*args, **kwargs):
341 from threading import Thread
342 def thread_target():
343 result = wrapper_browser(*args, **kwargs)
344 async_result.set_result(result)
345
346 thread = Thread(target=thread_target, daemon=True)
347 thread.start()
348 async_result = AsyncResult(thread)
349 return async_result
350
351 async_wrapper._driver_pool = wrapper_browser._driver_pool
352 async_wrapper.close = wrapper_browser.close

Callers

nothing calls this directly

Calls 3

AsyncResultClass · 0.90
AsyncQueueResultClass · 0.90
startMethod · 0.45

Tested by

no test coverage detected