Rename flow -> next

This commit is contained in:
Denis Blank 2017-11-30 07:12:31 +01:00
parent b4332b66c5
commit 95d5f25f84
5 changed files with 9 additions and 9 deletions

View File

@ -292,7 +292,7 @@ public:
///
/// // Will receive errors and results
/// http_request("github.com")
/// .flow(my_callable{});
/// .next(my_callable{});
/// ```
///
/// \param executor The optional executor which is used to dispatch
@ -303,7 +303,7 @@ public:
///
/// \since version 2.0.0
template <typename T, typename E = detail::types::this_thread_executor_tag>
auto flow(T&& callback,
auto next(T&& callback,
E&& executor = detail::types::this_thread_executor_tag{}) && {
return detail::base::chain_continuation<
detail::base::handle_results::yes,
@ -653,10 +653,10 @@ auto make_continuable(Continuation&& continuation) {
/// };
///
/// // Will receive errors and results
/// continuable.flow(my_callable{});
/// continuable.next(my_callable{});
/// ```
///
/// \note see continuable::flow for details.
/// \note see continuable::next for details.
///
/// \since version 2.0.0
using detail::types::dispatch_error_tag;

View File

@ -96,7 +96,7 @@ public:
void await_suspend(coroutine_handle<> h) {
// Forward every result to the current awaitable
std::move(continuable_)
.flow([h, this](auto&&... args) {
.next([h, this](auto&&... args) {
resolve(std::forward<decltype(args)>(args)...);
h.resume();
})

View File

@ -129,7 +129,7 @@ auto as_future(continuable_base<Data, Annotation>&& continuable) {
auto future = callback.get_future();
// Dispatch the continuation with the promise resolving callback
std::move(continuable).flow(std::move(callback)).done();
std::move(continuable).next(std::move(callback)).done();
return future;
}

View File

@ -67,7 +67,7 @@ struct my_callable {
};
int main(int, char**) {
http_request("github.com").flow(my_callable{});
http_request("github.com").next(my_callable{});
http_request("github.com") | [](std::string) {
// ...

View File

@ -65,7 +65,7 @@ TYPED_TEST(single_dimension_tests, are_yielding_errors_from_handlers) {
TYPED_TEST(single_dimension_tests, are_result_error_accepting) {
auto handled = std::make_shared<bool>(false);
auto continuation = this->supply(supply_test_exception())
.flow(fu2::overload(
.next(fu2::overload(
[handled] {
ASSERT_FALSE(*handled);
*handled = true;
@ -83,7 +83,7 @@ TYPED_TEST(single_dimension_tests, are_flow_error_accepting) {
auto handled = std::make_shared<bool>(false);
auto continuation =
this->supply_exception(supply_test_exception())
.flow(fu2::overload(
.next(fu2::overload(
[] {
// ...
FAIL();