26#include <seastar/core/future.hh>
27#include <seastar/core/make_task.hh>
28#include <seastar/util/modules.hh>
40template <
typename Func>
41requires std::is_nothrow_move_constructible_v<Func>
43schedule_in_group(scheduling_group sg, Func func)
noexcept {
44 static_assert(std::is_nothrow_move_constructible_v<Func>);
45 auto tsk = make_task(sg, std::move(func));
46 schedule_checked(tsk);
47 return tsk->get_future();
64template <
typename Func,
typename... Args>
65requires std::is_nothrow_move_constructible_v<Func>
69 static_assert(std::is_nothrow_move_constructible_v<Func>);
70 using return_type =
decltype(func(std::forward<Args>(args)...));
73 return futurator::invoke(func, std::forward<Args>(args)...);
75 return internal::schedule_in_group(sg, [func = std::move(func), args = std::make_tuple(std::forward<Args>(args)...)] ()
mutable {
76 return futurator::apply(func, std::move(args));
Identifies function calls that are accounted as a group.
Definition: scheduling.hh:285
auto with_scheduling_group(scheduling_group sg, Func func, Args &&... args) noexcept
run a callable (with some arbitrary arguments) in a scheduling group
Definition: with_scheduling_group.hh:68
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Converts a type to a future type, if it isn't already.
Definition: future.hh:1853