MCPcopy Create free account
hub / github.com/OpenRouterTeam/python-sdk / run_sync_in_thread

Function run_sync_in_thread

src/openrouter/utils/__init__.py:11–13  ·  view source on GitHub ↗

Run a synchronous function in a thread pool to avoid blocking the event loop.

(func: Callable[..., _T], *args)

Source from the content-addressed store, hash-verified

9
10
11async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T:
12 """Run a synchronous function in a thread pool to avoid blocking the event loop."""
13 return await asyncio.to_thread(func, *args)
14
15
16if TYPE_CHECKING:

Callers 2

doMethod · 0.90
do_request_asyncMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected