Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
Timer.hpp
Go to the documentation of this file.
1#pragma once
3#include <memory>
4
5namespace orbit::server {
6
7namespace detail { struct TimerState; }
8
16public:
17 TimerHandle() = default;
18
20 void cancel();
22 bool active() const;
23
24private:
25 friend class Scheduler;
26 explicit TimerHandle(std::shared_ptr<detail::TimerState> state) : state_(std::move(state)) {}
27 std::shared_ptr<detail::TimerState> state_;
28};
29
30} // namespace orbit::server
A timer from App::run_every() or App::run_after().
Definition Timer.hpp:15
bool active() const
True until cancelled, or until a run_after() timer has run.
std::shared_ptr< detail::TimerState > state_
Definition Timer.hpp:27
void cancel()
Stops the timer: no further runs start (one already running finishes).
TimerHandle(std::shared_ptr< detail::TimerState > state)
Definition Timer.hpp:26
friend class Scheduler
Definition Timer.hpp:25
Definition Http2Session.hpp:18
Definition json.hpp:5363