Skip to content

Commit

Permalink
rename and document BoostFutureAwaiter -> BoostFutureAwaitableOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
cwharris committed Oct 31, 2023
1 parent 222edcd commit fc49a12
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions python/mrc/_pymrc/include/pymrc/asyncio_runnable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename SignatureT>
class BoostFutureAwaiter
class BoostFutureAwaitableOperation
{
class Awaiter;

public:
BoostFutureAwaiter(std::function<SignatureT> fn) : m_fn(std::move(fn)) {}
BoostFutureAwaitableOperation(std::function<SignatureT> fn) : m_fn(std::move(fn)) {}

/**
* @brief Calls the wrapped function as an asyncboost fiber and returns a C++20 coroutine awaiter.
*/
template <typename... ArgsT>
auto operator()(ArgsT&&... args) -> Awaiter
{
Expand Down Expand Up @@ -118,7 +125,7 @@ class BoostFutureReader : public IReadable<T>
}

private:
BoostFutureAwaiter<mrc::channel::Status(T&)> m_awaiter;
BoostFutureAwaitableOperation<mrc::channel::Status(T&)> m_awaiter;
};

template <typename T>
Expand All @@ -143,7 +150,7 @@ class BoostFutureWriter : public IWritable<T>
}

private:
BoostFutureAwaiter<mrc::channel::Status(T&&)> m_awaiter;
BoostFutureAwaitableOperation<mrc::channel::Status(T&&)> m_awaiter;
};

template <typename T>
Expand Down

0 comments on commit fc49a12

Please sign in to comment.