23 #include <boost/noncopyable.hpp> 126 InternalEnum internal = InternalEnum::
NORMAL);
129 InternalEnum internal = InternalEnum::NORMAL);
178 template <
typename TCallback>
179 static std::unique_ptr<AsyncTimeout>
make(
181 TCallback&& callback);
212 template <
typename TCallback>
213 static std::unique_ptr<AsyncTimeout>
schedule(
216 TCallback&& callback);
241 template <
typename TCallback>
243 template <
typename UCallback>
249 noexcept(std::declval<TCallback>()()),
250 "callback must be declared noexcept, e.g.: `[]() noexcept {}`");
260 template <
typename TCallback>
263 TCallback&& callback) {
264 return std::unique_ptr<AsyncTimeout>(
266 std::addressof(manager), std::forward<TCallback>(callback)));
269 template <
typename TCallback>
273 TCallback&& callback) {
275 wrapper->scheduleTimeout(timeout);
std::chrono::milliseconds timeout_type
void timeoutExpired() noexceptoverride
const TimeoutManager * getTimeoutManager()
std::shared_ptr< RequestContext > context_
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
struct event * getEvent()
static std::unique_ptr< AsyncTimeout > make(TimeoutManager &manager, TCallback &&callback)
static void libeventCallback(libevent_fd_t fd, short events, void *arg)
void attachTimeoutManager(TimeoutManager *timeoutManager, InternalEnum internal=InternalEnum::NORMAL)
static std::unique_ptr< AsyncTimeout > schedule(TimeoutManager::timeout_type timeout, TimeoutManager &manager, TCallback &&callback)
async_timeout_wrapper(TimeoutManager *manager, UCallback &&callback)
void attachEventBase(EventBase *eventBase, InternalEnum internal=InternalEnum::NORMAL)
virtual void timeoutExpired() noexcept=0
bool scheduleTimeout(uint32_t milliseconds)
void detachTimeoutManager()
folly::Function< void()> callback_
TimeoutManager::InternalEnum InternalEnum
TimeoutManager * timeoutManager_