TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
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 |
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.
cpid::Cpid2kHeartBeater::Cpid2kHeartBeater | ( | Cpid2kWorkerInfo | info, |
std::string | prefix, | ||
std::string_view | host, | ||
int | port, | ||
int64_t | intevalMs = 10 * 1000 |
||
) |
cpid::Cpid2kHeartBeater::~Cpid2kHeartBeater | ( | ) |
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.
|
inline |