userver: userver/engine/task/cancel.hpp File Reference
No Matches
cancel.hpp File Reference

Task cancellation helpers. More...

#include <string>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <userver/engine/deadline.hpp>
+ Include dependency graph for cancel.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  engine::TaskCancellationBlocker
class  engine::TaskCancellationToken
 Cancellation token to given task object. More...


namespace  engine
 Asynchronous engine primitives.
namespace  engine::current_task
 Namespace with functions to work with current task from within it.


enum class  engine::TaskCancellationReason {
  engine::kNone ,
  engine::kUserRequest ,
  engine::kDeadline ,
  engine::kOverload ,
  engine::kAbandoned ,
 Task cancellation reason. More...


bool engine::current_task::IsCancelRequested () noexcept
 Checks for pending cancellation requests.
bool engine::current_task::ShouldCancel () noexcept
TaskCancellationReason engine::current_task::CancellationReason () noexcept
 Returns task cancellation reason for the current task.
void engine::current_task::CancellationPoint ()
 Throws an exception if a cancellation request for this task is pending.
void engine::current_task::SetDeadline (Deadline deadline)
TaskCancellationToken engine::current_task::GetCancellationToken ()
 Return cancellation token for current coroutine.
std::string_view engine::ToString (TaskCancellationReason reason) noexcept
 Returns a string representation of a cancellation reason.

Detailed Description

Task cancellation helpers.

Definition in file cancel.hpp.