From 95d5f25f843a6aff14e33b143a1a4e85ecc78d25 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Thu, 30 Nov 2017 07:12:31 +0100 Subject: [PATCH] Rename flow -> next --- include/continuable/continuable-base.hpp | 8 ++++---- include/continuable/detail/awaiting.hpp | 2 +- include/continuable/detail/transforms.hpp | 2 +- test/playground/test-playground.cpp | 2 +- test/unit-test/test-continuable-base-errors.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/continuable/continuable-base.hpp b/include/continuable/continuable-base.hpp index 9df34f6..f8da4a9 100644 --- a/include/continuable/continuable-base.hpp +++ b/include/continuable/continuable-base.hpp @@ -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 - 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; diff --git a/include/continuable/detail/awaiting.hpp b/include/continuable/detail/awaiting.hpp index f618fb5..6737662 100644 --- a/include/continuable/detail/awaiting.hpp +++ b/include/continuable/detail/awaiting.hpp @@ -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(args)...); h.resume(); }) diff --git a/include/continuable/detail/transforms.hpp b/include/continuable/detail/transforms.hpp index 661ecc8..2edaf95 100644 --- a/include/continuable/detail/transforms.hpp +++ b/include/continuable/detail/transforms.hpp @@ -129,7 +129,7 @@ auto as_future(continuable_base&& 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; } diff --git a/test/playground/test-playground.cpp b/test/playground/test-playground.cpp index f9310ec..02d7e76 100644 --- a/test/playground/test-playground.cpp +++ b/test/playground/test-playground.cpp @@ -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) { // ... diff --git a/test/unit-test/test-continuable-base-errors.cpp b/test/unit-test/test-continuable-base-errors.cpp index 42b7cd4..f40b7c5 100644 --- a/test/unit-test/test-continuable-base-errors.cpp +++ b/test/unit-test/test-continuable-base-errors.cpp @@ -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(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(false); auto continuation = this->supply_exception(supply_test_exception()) - .flow(fu2::overload( + .next(fu2::overload( [] { // ... FAIL();