From: Kefu Chai Date: Thu, 5 Nov 2020 04:46:52 +0000 (+0800) Subject: crimson/common: refactor crimson::do_until() X-Git-Tag: v16.1.0~681^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e785bc16a83875861bf01745356bd6cc311cfb4;p=ceph.git crimson/common: refactor crimson::do_until() * define `errorator_t` instead of `futurator` to simplify the code a little bit. * use seastar helper function / types when appropriate Signed-off-by: Kefu Chai --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 7c6f9fe20ad3..002c158dc7f8 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -49,24 +49,24 @@ inline auto do_for_each(Container& c, AsyncAction action) { template inline auto do_until(AsyncAction action) { - using futurator = \ - ::seastar::futurize>; + using errorator_t = + typename ::seastar::futurize_t>::errorator_type; while (true) { - auto f = futurator::invoke(action); + auto f = ::seastar::futurize_invoke(action); if (f.failed()) { - return futurator::type::errorator_type::template make_exception_future2<>( + return errorator_t::template make_exception_future2<>( f.get_exception() ); } else if (f.available()) { if (auto done = f.get0()) { - return futurator::type::errorator_type::template make_ready_future<>(); + return errorator_t::template make_ready_future<>(); } } else { return std::move(f)._then( [action = std::move(action)] (auto &&done) mutable { if (done) { - return futurator::type::errorator_type::template make_ready_future<>(); + return errorator_t::template make_ready_future<>(); } return ::crimson::do_until( std::move(action));