| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected