We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ananas::MakeReadyFuture() .Then([] { throw std::runtime_error("rrrrrrrrrrrrrrrrrrr"); return std::string{"Hello1"}; }) .Then([](ananas::Try<std::string>&& str) { try { std::string a = str; std::cout << a << std::endl; return 100; } catch (const std::runtime_error&) { std::cout << "xxxxxx" << std::endl; // 希望发生异常以后 退出 这个回调链 return 888; } }) .Then([](int nn) { std::cout << nn << std::endl; });
The text was updated successfully, but these errors were encountered:
目前有点受限制,Then接受的lambda必须以Future为参数,也就是前面的一个Then发起的是另外一个异步操作。 例如:
ananas::MakeReadyFuture() .Then([] { return ananas::Future<std::string>(); // 返回空的future,表示中断调用链 }) .Then([](Try<std::string>&& fut) { cout << "Never reach here" << endl; });
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: