hpx/io_service/schedule_timer.hpp

hpx/io_service/schedule_timer.hpp#

Defined in header hpx/io_service/schedule_timer.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace io#
namespace experimental#

Functions

template<typename Rep, typename Period>
auto schedule_timer_after(::asio::io_context &context, std::chrono::duration<Rep, Period> const duration) noexcept#

Return a sender that completes after the supplied duration has elapsed.

The timer starts when the sender’s operation state is started. Successful expiry produces set_value(), a stop request produces set_stopped(), and other timer failures produce set_error(std::exception_ptr). The supplied I/O context must be run until the operation completes.

Parameters:
  • context – The Asio I/O context on which the timer is run.

  • duration – The duration to wait after the operation is started.

Returns:

A sender representing the timer operation.

inline auto schedule_timer_at(::asio::io_context &context, std::chrono::steady_clock::time_point const time_point) noexcept#

Return a sender that completes at the supplied time point.

Successful expiry produces set_value(), a stop request produces set_stopped(), and other timer failures produce set_error(std::exception_ptr). The supplied I/O context must be run until the operation completes.

Parameters:
  • context – The Asio I/O context on which the timer is run.

  • time_point – The absolute time at which the sender should complete.

Returns:

A sender representing the timer operation.