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

Method execute

example/python.cpp:64–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 // this function takes the function F and runs it on the event loop.
63 template<class F>
64 void
65 execute(F f) const
66 {
67 py::gil_scoped_acquire lock;
68 py::handle loop(m_ptr);
69 struct wrapper // override the const.
70 {
71 mutable F impl;
72
73 void operator()( ) const
74 {
75 std::move(impl)();
76 }
77 };
78 loop.attr("call_soon_threadsafe")(py::cpp_function(wrapper{std::move(f)}));
79 }
80
81 bool
82 operator==(python_executor const &other) const noexcept

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected