20 #ifndef RIPPLE_APP_LEDGER_TIMEOUTCOUNTER_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_TIMEOUTCOUNTER_H_INCLUDED
23 #include <ripple/app/main/Application.h>
24 #include <ripple/beast/clock/abstract_clock.h>
25 #include <ripple/beast/utility/Journal.h>
26 #include <ripple/core/Job.h>
27 #include <boost/asio/basic_waitable_timer.hpp>
147 boost::asio::basic_waitable_timer<std::chrono::steady_clock>
timer_;
boost::asio::basic_waitable_timer< std::chrono::steady_clock > timer_
std::optional< std::uint32_t > jobLimit
virtual void cancel()
Cancel the task by marking it as failed if the task is not done.
void setTimer(ScopedLockType &)
Schedule a call to queueJob() after mTimerInterval.
virtual std::weak_ptr< TimeoutCounter > pmDowncast()=0
Return a weak pointer to this.
void queueJob(ScopedLockType &)
Queue a job to call invokeOnTimer().
bool progress_
Whether forward progress has been made.
This class is an "active" object.
std::recursive_mutex mtx_
void invokeOnTimer()
Calls onTimer() if in the right state.
A generic endpoint for log messages.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const uint256 hash_
The hash of the object (in practice, always a ledger) we are trying to fetch.
virtual ~TimeoutCounter()=default
QueueJobParameter queueJobParameter_
std::chrono::milliseconds timerInterval_
The minimum time to wait between calls to execute().
TimeoutCounter(Application &app, uint256 const &targetHash, std::chrono::milliseconds timeoutInterval, QueueJobParameter &&jobParameter, beast::Journal journal)
virtual void onTimer(bool progress, ScopedLockType &)=0
Hook called from invokeOnTimer().