MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / non_blocking

Function non_blocking

aura/worker_executor.py:138–145  ·  view source on GitHub ↗

Wrapper that attempts to convert blocking function into non-blocking if possible for asyncio use

(func, /, *args, **kwargs)

Source from the content-addressed store, hash-verified

136
137
138async def non_blocking(func, /, *args, **kwargs):
139 """
140 Wrapper that attempts to convert blocking function into non-blocking if possible for asyncio use
141 """
142 if sys.version_info[1] >= 9: # Available only in py3.9+
143 return await asyncio.to_thread(func, *args, **kwargs)
144 else: # Fallback, just call function directly in blocking mode
145 return func(*args, **kwargs)

Callers 2

fetch_packageFunction · 0.85
processMethod · 0.85

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected