MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / run_coro_and_wait

Method run_coro_and_wait

opcua/common/utils.py:189–197  ·  view source on GitHub ↗
(self, coro)

Source from the content-addressed store, hash-verified

187 return future.result()
188
189 def run_coro_and_wait(self, coro):
190 cond = threading.Condition()
191 def cb(_):
192 with cond:
193 cond.notify_all()
194 with cond:
195 task = self.create_task(coro, cb)
196 cond.wait()
197 return task.result()
198
199 def _run_until_complete(self, future, coro):
200 task = self.loop.run_until_complete(coro)

Callers 2

startMethod · 0.80
stopMethod · 0.80

Calls 1

create_taskMethod · 0.95

Tested by

no test coverage detected