CatapultServer
v0.5.0.1 (Elephant)
|
Classes | |
class | BasicTimedCallback |
Wraps a callback with a timer using an implicit strand. More... | |
Public Member Functions | |
StrandedTimedCallback (boost::asio::io_context &ioContext, const TCallback &callback, TCallbackArgs &&... timeoutArgs) | |
void | setTimeout (const utils::TimeSpan &timeout) |
Sets the timeout to timeout (starting from now). More... | |
void | setTimeoutHandler (const TimeoutHandlerType &handler) |
Sets the timeout handler to timeoutHandler. More... | |
template<typename... TArgs> | |
void | callback (TArgs &&... args) |
Invokes the wrapped callback with args. More... | |
template<typename THandler > | |
auto | wrap (THandler handler) |
Private Types | |
using | TimeoutHandlerType = action |
Private Member Functions | |
template<typename THandler > | |
void | post (THandler handler) |
Private Attributes | |
BasicTimedCallback< StrandedTimedCallback > | m_impl |
boost::asio::io_context::strand | m_strand |
StrandOwnerLifetimeExtender< StrandedTimedCallback > | m_strandWrapper |
Wraps a callback with a timer using an explicit strand and ensures deterministic shutdown by using enable_shared_from_this.
|
private |
|
inline |
Creates a timed callback by wrapping callback with a timed callback using ioContext. On a timeout, the callback is invoked with timeoutArgs.
|
inline |
Invokes the wrapped callback with args.
|
inlineprivate |
|
inline |
Sets the timeout to timeout (starting from now).
|
inline |
Sets the timeout handler to timeoutHandler.
|
inline |
|
private |
|
private |
|
private |