From 12c1a9fb765c778fdb6179dd38dfb934fe74c4b3 Mon Sep 17 00:00:00 2001 From: Matthew Murray Date: Fri, 15 May 2026 01:58:41 +0000 Subject: [PATCH] Add PyFutureCallback type alias for the asyncio Future-resolving callback --- .../rapidsmpf/streaming/_detail/libcoro_spawn_task.pxd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/rapidsmpf/rapidsmpf/streaming/_detail/libcoro_spawn_task.pxd b/python/rapidsmpf/rapidsmpf/streaming/_detail/libcoro_spawn_task.pxd index 2b1f8131b..0c611771a 100644 --- a/python/rapidsmpf/rapidsmpf/streaming/_detail/libcoro_spawn_task.pxd +++ b/python/rapidsmpf/rapidsmpf/streaming/_detail/libcoro_spawn_task.pxd @@ -9,6 +9,14 @@ cdef extern from * nogil: #include #include + /** + * @brief Callback used to resolve a Python asyncio.Future from C++. + * + * Takes an opaque pointer to the Python Future and an optional + * null-terminated error message. NULL means success. + */ + using PyFutureCallback = void (*)(void*, const char *); + /** * @brief Await a C++ coro::task and notify a Python asyncio.Future on completion. * @@ -34,7 +42,7 @@ cdef extern from * nogil: * and the Python Future has been notified. */ coro::task cython_libcoro_task_wrapper( - void (*cpp_set_py_future)(void*, const char *), + PyFutureCallback cpp_set_py_future, rapidsmpf::OwningWrapper py_future, coro::task task ) {