50 :
Mailbox(endpoint), _shutdownRequested(false), _period(period), _worker(nullptr) { }
PeriodicService(Endpoint *endpoint, std::chrono::milliseconds period)
Construct a new Periodic Service object.
std::atomic< bool > _shutdownRequested
Worker thread shutdown requested.
virtual void MailboxWillBeDisconnected() noexceptoverride
Called right before the mailbox is disconnected from its endpoint or if the attached endpoint is abou...
virtual void MailboxWasConnected() noexceptoverride
Called when the mailbox is attached to an already running endpoint or if the attached endpoint has ju...
void Worker()
Worker thread entry point.
A service that uses a periodic background worker to perform its work.
std::thread * _worker
Worker thread.
Abstract base class for Endpoint implementations.
std::chrono::milliseconds _period
Tick period.
virtual void Update()=0
Called periodically to perform work.
Abstract base class for Mailbox implementations.