MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / _finishedOrCancelled

Method _finishedOrCancelled

src/PyEventLoop.cc:268–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268bool PyEventLoop::AsyncHandle::_finishedOrCancelled() {
269 PyObject *scheduled = PyObject_GetAttrString(_handle, "_scheduled"); // this attribute only exists on asyncio.TimerHandle returned by loop.call_later
270 // NULL if no such attribute (on a strict asyncio.Handle returned by loop.call_soon)
271 bool notScheduled = scheduled && scheduled == Py_False; // not scheduled means the job function has already been executed or canceled
272 Py_XDECREF(scheduled);
273 return notScheduled;
274}
275
276void PyEventLoop::Future::setResult(PyObject *result) {
277 // https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.set_result

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected