| 93 | } |
| 94 | |
| 95 | PyEventLoop::AsyncHandle::id_t PyEventLoop::enqueueWithDelay(PyObject *jobFn, double delaySeconds, bool repeat) { |
| 96 | auto handleId = PyEventLoop::AsyncHandle::newEmpty(); |
| 97 | if (!_enqueueWithDelay(_loop, handleId, jobFn, delaySeconds, repeat)) { |
| 98 | PyErr_Print(); // RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one |
| 99 | } |
| 100 | auto handle = PyEventLoop::AsyncHandle::fromId(handleId); |
| 101 | handle->addRef(); |
| 102 | return handleId; |
| 103 | } |
| 104 | |
| 105 | PyEventLoop::Future PyEventLoop::createFuture() { |
| 106 | // https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_future |
no test coverage detected