ark::pipeline::ShutdownToken
Defined in header “ark/pipeline/shutdown_token.hh”.
These tokens can be retrieved from a stage interface, and allow customers to request a shutdown of the pipeline.
Methods
-
ShutdownToken(ShutdownTokenType type, std::string owner, TimeProviderPtr time_provider)
Constructor. Initializes a shutdown token on behalf of the given owner. -
void request_successful_shutdown()
Requests that shutdown completes successfully. Uses the token’s time provider to determine when the shutdown should take effect, essentially calling ’now'. -
void request_failure_shutdown(std::string reason)
Requests that shutdown completes with an error. Uses the token’s time provider to determine when the shutdown should take effect, essentially calling ’now'. -
bool shutdown_desired(const std::chrono::steady_clock::time_point & now)
Returns true if this token desires a shutdown, false otherwise. Note that even if shutdown is requested, this will not return true until ’now’ is equal to or greater than the actual requested shutdown time. -
ShutdownTokenType type()
Returns the type of the token. -
const std::string & owner()
Returns the name of the owner of this token. -
bool was_request_successful()
Returns true if the shutdown requested was successful or failed. -
std::string request_reason()
Returns the reason for the shutdown. -
std::chrono::steady_clock::time_point shutdown_time()
Returns the time that shutdown was requested at.