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

Function async_wrapper

botasaurus/request_decorator.py:237–248  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

235
236 @wraps(func)
237 def async_wrapper(*args, **kwargs):
238 from threading import Thread
239
240 def thread_target():
241 result = wrapper_requests(*args, **kwargs)
242 async_result.set_result(result)
243
244 thread = Thread(target=thread_target, daemon=True)
245 thread.start()
246 async_result = AsyncResult(thread)
247 async_wrapper.close = wrapper_requests.close
248 return async_result
249
250 return async_wrapper
251

Callers

nothing calls this directly

Calls 3

AsyncResultClass · 0.90
AsyncQueueResultClass · 0.90
startMethod · 0.45

Tested by

no test coverage detected