Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

cancel_at (3 of 6 overloads)

Adapt a completion token to cancel an operation if not complete by the specified absolute time.

template<
    typename CompletionToken,
    typename Clock,
    typename Duration>
cancel_at_t< decay_t< CompletionToken >, Clock > cancel_at(
    const chrono::time_point< Clock, Duration > & expiry,
    CompletionToken && completion_token);
Thread Safety

When an asynchronous operation is used with cancel_at, a timer async_wait operation is performed in parallel to the main operation. If this parallel async_wait completes first, a cancellation request is emitted to cancel the main operation. Consequently, the application must ensure that the asynchronous operation is performed within an implicit or explicit strand.


PrevUpHomeNext