29#include <seastar/core/future.hh>
30#include <seastar/core/timed_out_error.hh>
32#include <seastar/util/modules.hh>
53template<
typename ExceptionFactory = default_timeout_exception_factory,
typename Clock,
typename Duration,
typename... T>
58 auto pr = std::make_unique<
promise<T...>>();
61 pr.set_exception(std::make_exception_ptr(ExceptionFactory::timeout()));
67 f.forward_to(std::move(*pr));
A representation of a possibly not-yet-computed value.
Definition: future.hh:1240
futurize_t< FuncResult > then_wrapped(Func &&func) &noexcept
Schedule a block of code to run when the future is ready, allowing for exception handling.
Definition: future.hh:1525
bool available() const noexcept
Checks whether the future is available.
Definition: future.hh:1394
void ignore_ready_future() noexcept
Ignore any result hold by this future.
Definition: future.hh:1766
promise - allows a future value to be made available at a later time.
Definition: future.hh:934
void arm(time_point until, std::optional< duration > period={}) noexcept
future< T > get_future() noexcept
Gets the promise's associated future.
Definition: future.hh:1926
future< T... > with_timeout(std::chrono::time_point< Clock, Duration > timeout, future< T... > f)
Wait for either a future, or a timeout, whichever comes first.
Definition: with_timeout.hh:54
Seastar API namespace.
Definition: abort_on_ebadf.hh:26