MCPcopy Create free account
hub / github.com/openai/openai-agents-python / run

Function run

tests/sandbox/test_materialization.py:19–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18 def task_factory(index: int) -> Callable[[], Awaitable[str]]:
19 async def run() -> str:
20 nonlocal active_tasks
21 nonlocal max_active_tasks
22 active_tasks += 1
23 max_active_tasks = max(max_active_tasks, active_tasks)
24 started_tasks.append(index)
25 try:
26 await release_tasks.wait()
27 return f"result-{index}"
28 finally:
29 active_tasks -= 1
30
31 return run
32

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected