6#include <userver/engine/deadline.hpp>
7#include <userver/engine/future_status.hpp>
8#include <userver/engine/impl/context_accessor.hpp>
9#include <userver/engine/impl/wait_list_fwd.hpp>
10#include <userver/utils/fast_pimpl.hpp>
12USERVER_NAMESPACE_BEGIN
45class SingleUseEvent
final :
private impl::ContextAccessor {
47 SingleUseEvent()
noexcept;
49 SingleUseEvent(
const SingleUseEvent&) =
delete;
50 SingleUseEvent(SingleUseEvent&&) =
delete;
51 SingleUseEvent& operator=(
const SingleUseEvent&) =
delete;
52 SingleUseEvent& operator=(SingleUseEvent&&) =
delete;
76 [[nodiscard]]
bool IsReady()
const noexcept override;
80 impl::ContextAccessor* TryGetContextAccessor()
noexcept {
return this; }
84 friend class impl::FutureWaitStrategy<SingleUseEvent>;
86 impl::EarlyWakeup TryAppendWaiter(impl::TaskContext& waiter)
override;
87 void RemoveWaiter(impl::TaskContext& waiter)
noexcept override;
88 void RethrowErrorResult()
const override;
89 void AfterWait()
noexcept override;
91 impl::FastPimplWaitListLight waiters_;