MCPcopy Index your code
hub / github.com/RustPython/RustPython / _coro_promise

Function _coro_promise

crates/wasm/Lib/asyncweb.py:127–140  ·  view source on GitHub ↗
(coro)

Source from the content-addressed store, hash-verified

125
126
127def _coro_promise(coro):
128 prom = CallbackPromise()
129
130 async def run_coro():
131 try:
132 res = await coro
133 except BaseException as e:
134 prom.reject(e)
135 else:
136 prom.resolve(res)
137
138 run(run_coro())
139
140 return prom
141
142
143def _call_resolve(f, arg):

Callers 2

spawnFunction · 0.85
_resolveFunction · 0.85

Calls 3

CallbackPromiseClass · 0.85
run_coroFunction · 0.85
runFunction · 0.70

Tested by

no test coverage detected