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

Function async_wrapper

botasaurus/task_decorator.py:211–222  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

209
210 @wraps(func)
211 def async_wrapper(*args, **kwargs):
212 from threading import Thread
213
214 def thread_target():
215 result = wrapper_requests(*args, **kwargs)
216 async_result.set_result(result)
217
218 thread = Thread(target=thread_target, daemon=True)
219 thread.start()
220 async_result = AsyncResult(thread)
221 async_wrapper.close = wrapper_requests.close
222 return async_result
223
224 return async_wrapper
225

Callers

nothing calls this directly

Calls 3

AsyncResultClass · 0.90
AsyncQueueResultClass · 0.90
startMethod · 0.45

Tested by

no test coverage detected