UniSet @VERSION@
Открытые типы | Открытые члены | Полный список членов класса
Класс uniset::ProcessManager

Открытые типы

using ProcessCallback = std::function< void(const ProcessInfo &)>
 

Открытые члены

 ProcessManager (std::shared_ptr< Configuration > conf=nullptr)
 
void setNodeName (const std::string &name)
 
std::string getNodeName () const
 
void setHealthCheckInterval (size_t msec)
 
void setRestartWindow (size_t msec)
 
void setStopTimeout (size_t msec)
 
void setCommonArgs (const std::vector< std::string > &args)
 
void setPassthroughArgs (const std::vector< std::string > &args)
 
void setForwardArgs (const std::vector< std::string > &args)
 
void addProcess (const ProcessInfo &proc)
 
void addGroup (const ProcessGroup &group)
 
bool startAll ()
 
void stopAll ()
 
void restartAll ()
 Restart all running processes.
 
void reloadAll ()
 Stop all, then start all (except skip, manual). Oneshot processes ARE re-run.
 
void requestStop ()
 Set stopping_ flag (async-signal-safe)
 
void cancelStartup ()
 
bool isBulkOperationInProgress () const
 
BulkOperation currentBulkOperation () const
 
bool restartProcess (const std::string &name)
 
bool stopProcess (const std::string &name)
 
bool startProcess (const std::string &name)
 
void startMonitoring ()
 
void stopMonitoring ()
 
bool isMonitoring () const
 
ProcessState getProcessState (const std::string &name) const
 
ProcessInfo getProcessInfo (const std::string &name) const
 
std::vector< ProcessInfogetAllProcesses () const
 
std::vector< ProcessGroupgetAllGroups () const
 
bool allRunning () const
 
bool anyCriticalFailed () const
 
std::vector< std::string > getFullArgs (const std::string &name) const
 Get full arguments list for a process (commonArgs + args + forwardArgs)
 
void printRunList (std::ostream &out) const
 
void setOnProcessStarted (ProcessCallback cb)
 
void setOnProcessStopped (ProcessCallback cb)
 
void setOnProcessFailed (ProcessCallback cb)
 
std::shared_ptr< DebugStreamlog ()
 

Методы

◆ cancelStartup()

void uniset::ProcessManager::cancelStartup ( )

Interrupt any active startup phase WITHOUT marking the process for shutdown. Sets only stopping_=true (not shutdownRequested_), so an in-flight restartAll()/reloadAll() bails out of its startAll() phase quickly while the launcher process keeps running. Suitable for HTTP-driven stop-all that wants to abort an active bulk operation but does not want to terminate the launcher itself. After the subsequent stopAll() completes, stopping_ is restored to shutdownRequested_ (false here), allowing restart-all/reload-all to be re-armed.

◆ getFullArgs()

std::vector< std::string > uniset::ProcessManager::getFullArgs ( const std::string &  name) const

Get full arguments list for a process (commonArgs + args + forwardArgs)

◆ printRunList()

void uniset::ProcessManager::printRunList ( std::ostream &  out) const

Print run list (dry-run mode). Shows what will be launched, with what parameters, in what order.

Аргументы
outOutput stream (e.g. std::cout)

◆ reloadAll()

void uniset::ProcessManager::reloadAll ( )

Stop all, then start all (except skip, manual). Oneshot processes ARE re-run.

◆ requestStop()

void uniset::ProcessManager::requestStop ( )

Set stopping_ flag (async-signal-safe)

◆ restartAll()

void uniset::ProcessManager::restartAll ( )

Restart all running processes.