cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
|
Class of state machines of background tasks in connections and acceptors. More...
#include <msgpack_rpc/transport/background_task_state_machine.h>
Public Types | |
enum class | State { INIT , STARTING , PROCESSING , STOPPED } |
Enumeration of states. More... |
Public Member Functions | |
BackgroundTaskStateMachine ()=default | |
Constructor. | |
void | handle_processing_started () |
Handle the condition that processing is started. | |
void | handle_processing_stopped () |
Handle the condition that processing has been stopped. | |
void | handle_start_request () |
Handle the condition that starting processing is requested. | |
bool | handle_stop_requested () |
Handle the condition that stopping processing is requested. | |
bool | is_processing () const noexcept |
Check whether processing. |
Private Attributes | |
std::atomic< State > | state_ {State::INIT} |
Whether the process of this connection is started. |
Class of state machines of background tasks in connections and acceptors.
Definition at line 33 of file background_task_state_machine.h.
|
strong |
Enumeration of states.
Enumerator | |
---|---|
INIT | Initial state. |
STARTING | Starting. |
PROCESSING | Processing. |
STOPPED | Stopped. |
Definition at line 36 of file background_task_state_machine.h.
|
inline |
Handle the condition that processing is started.
Definition at line 69 of file background_task_state_machine.h.
|
inline |
Handle the condition that processing has been stopped.
Definition at line 87 of file background_task_state_machine.h.
|
inline |
Handle the condition that starting processing is requested.
Definition at line 56 of file background_task_state_machine.h.
|
inline |
Handle the condition that stopping processing is requested.
true | Not stopped yet, so stop is required. |
false | Already stopped, so stop is not required. |
Definition at line 79 of file background_task_state_machine.h.
|
inlinenodiscardnoexcept |
Check whether processing.
true | Currently processing. |
false | Currently not processing. |
Definition at line 97 of file background_task_state_machine.h.
|
private |
Whether the process of this connection is started.
Definition at line 103 of file background_task_state_machine.h.