diff --git a/python/mrc/_pymrc/include/pymrc/asyncio_runnable.hpp b/python/mrc/_pymrc/include/pymrc/asyncio_runnable.hpp index 5979cad12..13c4d4c0a 100644 --- a/python/mrc/_pymrc/include/pymrc/asyncio_runnable.hpp +++ b/python/mrc/_pymrc/include/pymrc/asyncio_runnable.hpp @@ -36,14 +36,21 @@ namespace mrc::pymrc { +/** + * @brief A wrapper for executing a function as an async boost fiber, the result of which is a + * C++20 coroutine awaiter. + */ template -class BoostFutureAwaiter +class BoostFutureAwaitableOperation { class Awaiter; public: - BoostFutureAwaiter(std::function fn) : m_fn(std::move(fn)) {} + BoostFutureAwaitableOperation(std::function fn) : m_fn(std::move(fn)) {} + /** + * @brief Calls the wrapped function as an asyncboost fiber and returns a C++20 coroutine awaiter. + */ template auto operator()(ArgsT&&... args) -> Awaiter { @@ -118,7 +125,7 @@ class BoostFutureReader : public IReadable } private: - BoostFutureAwaiter m_awaiter; + BoostFutureAwaitableOperation m_awaiter; }; template @@ -143,7 +150,7 @@ class BoostFutureWriter : public IWritable } private: - BoostFutureAwaiter m_awaiter; + BoostFutureAwaitableOperation m_awaiter; }; template