Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

cancel_at (1 of 6 overloads)

Create a partial completion token adapter that cancels an operation if not complete by the specified absolute time.

template<
    typename Clock,
    typename Duration>
partial_cancel_at< Clock > cancel_at(
    const chrono::time_point< Clock, Duration > & expiry,
    cancellation_type_t cancel_type = cancellation_type::terminal);
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