userver: userver/engine/task/task.hpp Source File
Loading...
Searching...
No Matches
task.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <userver/compiler/impl/lifetime.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace engine {
13
22class [[nodiscard]] Task : public TaskBase {
23public:
28
32
35 Task(Task&& other) noexcept;
36
40 Task& operator=(Task&& other) noexcept;
41
42 Task(const Task&) = delete;
43 Task& operator=(const Task&) = delete;
44
46 AwaitableToken GetAwaitableToken() noexcept USERVER_IMPL_LIFETIME_BOUND;
47
48protected:
50 // For internal use only.
51 explicit Task(impl::TaskContextHolder&& context);
53
54private:
55 friend void DetachUnscopedUnsafe(Task&& task);
56};
57
68
69} // namespace engine
70
71USERVER_NAMESPACE_END