]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: specialize seastar::is_future<> for interruptible_future<>
authorKefu Chai <tchaikov@gmail.com>
Fri, 4 Mar 2022 17:36:36 +0000 (01:36 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 4 Mar 2022 17:42:16 +0000 (01:42 +0800)
this ensures that seastar helper functions are able to accept
interruptible_future<> in place of vanilla seastar::future<>.

for instance, if concepts is enabled, seastar::when_all_succeed()
has a set of constraits which include:

is_future<std::remove_reference_t<decltype(*i)>>::value

where i is the iterator passed to this function. so, to ensure
seastar::when_all_succeed() works with interruptible_future,
we need to teach the is_future<> to accept interruptible_future
as well.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/common/interruptible_future.h

index d7f09b6dfa086516bdb725030d21d4515ff9023d..517039b3269265192983fd5a605cb9191f682297 100644 (file)
@@ -1556,4 +1556,10 @@ struct continuation_base_from_future<
   using type = typename seastar::continuation_base_from_future<FutureType>::type;
 };
 
+template <typename InterruptCond, typename FutureType>
+struct is_future<
+  ::crimson::interruptible::interruptible_future_detail<
+    InterruptCond,
+    FutureType>>
+ : std::true_type {};
 } // namespace seastar