Closed IronsDu closed 4 years ago
Straight start one async operation?And use co_await in it's lambda ?Thank you.
Hey, if I understood you right, you can do something like the following:
([]() -> continuable<> {
co_await async([] {
// ..
});
co_return;
}()).then([] { /* ... */ });
If that doesn't help you, try to explain your question more in detail please, since it's difficult for me to get the actual question out of your two sentences. Maybe you could provide an example what you are trying to accomplish, so I can understand your actual use case better.
Thank you for reply me. my questions is :
make_range_looper
function error:https://github.com/Naios/continuable/blob/fa589a1e9506dc96b3f511791625c7a03b2c2252/include/continuable/detail/operations/loop.hpp#L166Probably it is better for you to retrieve the promise callback from continuable as following:
continuable<> do_something_with_redis(std::string some_param) {
return make_continuable<void>([some_param] (auto&& promise) mutable {
WaitReplyCallback::Ptr wrapperCallback = std::make_shared<WaitReplyCallback>();
wrapperCallback->callback = [promise = std::forward<decltype(promise)>(promise)]() mutable {
promise.set_value();
};
});
}
// And then work with the do_something_with_redis like the following
continuable<> do_sth() {
co_await do_something_with_redis("param");
co_await do_something_else();
co_return;
}
For further guidance please take a look at the documentation.
Because of the VS 2019 build issue please open another issue with a reproducable example that yields the error you mentioned above.
Since there was no further activity on this issue I'm marking it as resolved. If you encounter any new bugs or questions open a new issue please.
@Naios
Commit Hash
{Please write here}
Expected Behavior
{Please write here}
Actual Behavior
{Please write here}
Steps to Reproduce
{Please write here}
Your Environment