MCPcopy Create free account
hub / github.com/boostorg/cobalt / get_loop

Function get_loop

example/python.cpp:23–28  ·  view source on GitHub ↗

Small helper function to get the current event loop for python

Source from the content-addressed store, hash-verified

21
22// Small helper function to get the current event loop for python
23py::object get_loop()
24{
25 auto mod = py::module_::import_("asyncio");
26 auto getter = mod.attr("get_event_loop");
27 return getter();
28}
29
30// An asio::any_io_executor compatible wrapper around the event loop.
31// all the query functions are for that compatibility.

Callers 2

python_executorMethod · 0.85
await_suspendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected