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

Method enqueueWithDelay

src/PyEventLoop.cc:95–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95PyEventLoop::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
105PyEventLoop::Future PyEventLoop::createFuture() {
106 // https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_future

Callers 1

enqueueWithDelayFunction · 0.80

Calls 2

_enqueueWithDelayFunction · 0.85
addRefMethod · 0.80

Tested by

no test coverage detected