mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
More work on await
This commit is contained in:
parent
6001e99723
commit
a6b6148f44
@ -49,12 +49,14 @@ using std::experimental::coroutine_handle;
|
||||
/// An object which provides the internal buffer and helper methods
|
||||
/// for waiting on a continuable in a stackless coroutine.
|
||||
template <typename Continuable>
|
||||
struct awaitable {
|
||||
class awaitable {
|
||||
/// The continuable which is invoked upon suspension
|
||||
Continuable continuable_;
|
||||
/// A cache which is used to pass the result of the continuation
|
||||
/// to the
|
||||
expected::expected<int /*TODO*/> cache_;
|
||||
|
||||
/// A cache which is used to
|
||||
// expected::expected<int> cache_;
|
||||
|
||||
public:
|
||||
/// Since continuables are evaluated lazily we are not
|
||||
/// capable to say whether the resumption will be instantly.
|
||||
bool await_ready() const noexcept {
|
||||
@ -77,6 +79,7 @@ struct awaitable {
|
||||
// return
|
||||
}
|
||||
|
||||
private:
|
||||
/// Resolve the continuation through the result
|
||||
template <typename... Args>
|
||||
void resolve(Args&&... args) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user