userver: userver/utils/impl/wrapped_call_base.hpp Source File
Loading...
Searching...
No Matches
wrapped_call_base.hpp
1#pragma once
2
3USERVER_NAMESPACE_BEGIN
4
5namespace utils::impl {
6
7/// The engine-facing side of an asynchronous task payload. The engine will
8/// call `Perform` or `Reset` at most once.
9class WrappedCallBase {
10 public:
11 WrappedCallBase(WrappedCallBase&&) = delete;
12 virtual ~WrappedCallBase();
13
14 /// Invoke the wrapped function call, then destroy the functor
15 /// (but not the held result)
16 virtual void Perform() = 0;
17
18 /// Rethrow the stored exception result of the call, if any
19 virtual void RethrowErrorResult() const = 0;
20
21 protected:
22 WrappedCallBase() noexcept;
23};
24
25} // namespace utils::impl
26
27USERVER_NAMESPACE_END