TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | List of all members
cpid::Cpid2kHeartBeater Class Reference

Periodically sends out heartbeats to a Redis instance. More...

#include <cpid2kworker.h>

Public Member Functions

 Cpid2kHeartBeater (Cpid2kWorkerInfo info, std::string prefix, std::string_view host, int port, int64_t intevalMs=10 *1000)
 
 ~Cpid2kHeartBeater ()
 
bool consideredDead () const
 Returns true if the worker is considered dead by the scheduler. More...
 
int64_t intervalMs () const
 

Detailed Description

Periodically sends out heartbeats to a Redis instance.

The supplied Cpid2kWorkerInfo will be sent as the heartbeat value to the database. In addition, during construction this class will ensure that startup can be performed according to the scheduler (see the supplied Redis schema). If not, the constructor will throw.

Constructor & Destructor Documentation

cpid::Cpid2kHeartBeater::Cpid2kHeartBeater ( Cpid2kWorkerInfo  info,
std::string  prefix,
std::string_view  host,
int  port,
int64_t  intevalMs = 10 * 1000 
)
cpid::Cpid2kHeartBeater::~Cpid2kHeartBeater ( )

Member Function Documentation

bool cpid::Cpid2kHeartBeater::consideredDead ( ) const

Returns true if the worker is considered dead by the scheduler.

In this case, the worker should abort its execution.

int64_t cpid::Cpid2kHeartBeater::intervalMs ( ) const
inline

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