MySQL 8.0.40
Source Code Documentation
|
manages the state of the process. More...
#include <process_state_component.h>
Public Types | |
using | key_type = std::string |
using | on_shutdown_request_callback = std::function< void(ShutdownPending::Reason reason, const std::string &msg)> |
Public Member Functions | |
ProcessStateComponent (ProcessStateComponent const &)=delete | |
void | operator= (ProcessStateComponent const &)=delete |
ProcessStateComponent (ProcessStateComponent &&)=delete | |
void | operator= (ProcessStateComponent &&)=delete |
void | clear () |
void | request_application_shutdown (const ShutdownPending::Reason reason=ShutdownPending::Reason::REQUESTED, const std::string &msg={}) |
request application shutdown. More... | |
void | register_on_shutdown_request_callback (on_shutdown_request_callback callback) |
register a callback that will get exectued whenever the component gets the shutdown request More... | |
WaitableMonitor< ShutdownPending > & | shutdown_pending () |
pending shutdown state. More... | |
Static Public Member Functions | |
static ProcessStateComponent & | get_instance () |
Private Member Functions | |
ProcessStateComponent ()=default | |
Private Attributes | |
WaitableMonitor< ShutdownPending > | shutdown_pending_ {{}} |
std::vector< on_shutdown_request_callback > | on_shutdown_request_callbacks_ |
manages the state of the process.
allows to shutdown the current process in a
way.
To be used
using mysql_harness::ProcessStateComponent::key_type = std::string |
using mysql_harness::ProcessStateComponent::on_shutdown_request_callback = std::function<void( ShutdownPending::Reason reason, const std::string &msg)> |
|
delete |
|
delete |
|
privatedefault |
void mysql_harness::ProcessStateComponent::clear | ( | ) |
|
static |
|
delete |
|
delete |
|
inline |
register a callback that will get exectued whenever the component gets the shutdown request
callback | callback to execute when the shutdown is requested |
void mysql_harness::ProcessStateComponent::request_application_shutdown | ( | const ShutdownPending::Reason | reason = ShutdownPending::Reason::REQUESTED , |
const std::string & | msg = {} |
||
) |
request application shutdown.
reason | reason for the shutdown |
msg | human readable reason of the shutdown |
std::system_error | same as std::unique_lock::lock does |
std::system_error | same as std::unique_lock::lock does |
|
inline |
pending shutdown state.
|
private |
|
private |