Query Cancellation

class CancellationToken : public zenoh::Owned<::z_owned_cancellation_token_t>

A Zenoh Cancellation token that can be used.

Warning

This API has been marked as unstable: it works as advertised, but it may be changed in a future release.

Constructors

inline CancellationToken()

Construct a new cancellation token.

inline CancellationToken(const CancellationToken &other)

Copy constructor.

Cancelling a token also cancels all of its copies.

Operators

Assignment operator.

Methods

inline void cancel(ZResult *err = nullptr)

Interrupt all currently running get calls, to which clones of the token were passed.

inline bool is_cancelled() const

Verify if token was cancelled.

Returns:

true if token was cancelled (i.e if cancel was called on it or one of its copies), false otherwise.