| 240 | } |
| 241 | |
| 242 | void PyEventLoop::AsyncHandle::cancel() { |
| 243 | if (!_finishedOrCancelled()) { |
| 244 | removeRef(); // automatically unref at finish |
| 245 | } |
| 246 | |
| 247 | // https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Handle.cancel |
| 248 | PyObject *ret = PyObject_CallMethod(_handle, "cancel", NULL); // returns None |
| 249 | Py_XDECREF(ret); |
| 250 | } |
| 251 | |
| 252 | /* static */ |
| 253 | bool PyEventLoop::AsyncHandle::cancelAll() { |
no outgoing calls
no test coverage detected