Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
app::Stopper Class Reference

Application stopper class. On stop it will create a new thread to run all the shutdown tasks. More...

#include <Stopper.hpp>

Public Member Functions

 ~Stopper ()
 Destroy the Stopper object.
 
void setOnStop (std::function< void(boost::asio::yield_context)> cb)
 Set the callback to be called when the application is stopped.
 
void stop ()
 Stop the application and run the shutdown tasks.
 

Static Public Member Functions

template<web::ng::SomeServer ServerType, etl::SomeLoadBalancer LoadBalancerType, etl::SomeETLService ETLServiceType>
static std::function< void(boost::asio::yield_context)> makeOnStopCallback (ServerType &server, LoadBalancerType &balancer, ETLServiceType &etl, feed::SubscriptionManagerInterface &subscriptions, data::BackendInterface &backend, boost::asio::io_context &ioc)
 Create a callback to be called on application stop.
 

Detailed Description

Application stopper class. On stop it will create a new thread to run all the shutdown tasks.

Member Function Documentation

◆ makeOnStopCallback()

template<web::ng::SomeServer ServerType, etl::SomeLoadBalancer LoadBalancerType, etl::SomeETLService ETLServiceType>
static std::function< void(boost::asio::yield_context)> app::Stopper::makeOnStopCallback ( ServerType & server,
LoadBalancerType & balancer,
ETLServiceType & etl,
feed::SubscriptionManagerInterface & subscriptions,
data::BackendInterface & backend,
boost::asio::io_context & ioc )
inlinestatic

Create a callback to be called on application stop.

Parameters
serverThe server to stop.
balancerThe load balancer to stop.
etlThe ETL service to stop.
subscriptionsThe subscription manager to stop.
backendThe backend to stop.
iocThe io_context to stop.
Returns
The callback to be called on application stop.

◆ setOnStop()

void app::Stopper::setOnStop ( std::function< void(boost::asio::yield_context)> cb)

Set the callback to be called when the application is stopped.

Parameters
cbThe callback to be called on application stop.

The documentation for this class was generated from the following files: