File InMemoryStateRegistry.h

namespace faabric
namespace state

WARNING - key-value objects are shared between threads, BUT hiredis is not thread-safe, so make sure you always retrieve the reference to Redis inline rather than sharing a reference within the class.

class InMemoryStateRegistry

Public Functions

InMemoryStateRegistry() = default
std::string getMasterIP(const std::string &user, const std::string &key, const std::string &thisIP, bool claim)
std::string getMasterIPForOtherMaster(const std::string &userIn, const std::string &keyIn, const std::string &thisIP)
void clear()

Private Members

std::unordered_map<std::string, std::string> mainMap
std::shared_mutex mainMapMutex