|
GlitchyByte Lib
0.3.1
GlitchyByte general library to bootstrap development.
|
Public Member Functions | |
| bool | shouldShutdown () const noexcept |
| void | shutdown () noexcept |
| void | awaitShutdown (std::chrono::milliseconds const &timeout) noexcept |
| void | awaitShutdown () noexcept |
| void | whileLive (std::chrono::milliseconds const &cadence, std::function< void()> const &action) |
Static Public Member Functions | |
| static std::shared_ptr< ShutdownMonitor > | create () noexcept |
Utility to monitor SIGINT and SIGTERM for proper application shutdown.
|
inlinestaticnoexcept |
Creates a monitor that will get notified when it's time for an orderly shutdown.
|
inlinenoexcept |
Returns true when an orderly shutdown should occur.
|
inlinenoexcept |
Manually triggers an orderly shutdown.
|
inlinenoexcept |
Awaits for a shutdown or expiration of the given timeout.
If a shutdown has been triggered, the method will exit fast.
| timeout | Time to wait for shutdown. |
|
inlinenoexcept |
Awaits for a shutdown.
If a shutdown has been triggered, the method will exit fast.
|
inline |
Convenience method to execute an action periodically at the given cadence, until a shutdown is triggered.
| cadence | Cadence at which to execute the action. |
| action | Action to execute. |