MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / blocking

Function blocking

tests/lib/tools/test_session_runner.py:1915–1919  ·  view source on GitHub ↗
(_input: object)

Source from the content-addressed store, hash-verified

1913 release = threading.Event()
1914
1915 def blocking(_input: object) -> str:
1916 loop.call_soon_threadsafe(release.set)
1917 if not release.wait(timeout=2):
1918 raise RuntimeError("the event loop did not run while the tool blocked")
1919 return "released"
1920
1921 events = FakeAsyncEvents(stream_events=[_custom_tool_use("ctu_1", "blocking", {}), _terminated()])
1922

Callers

nothing calls this directly

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected