File State.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.
Enums
-
class State
Public Functions
-
explicit State(std::string thisIPIn)
-
size_t getStateSize(const std::string &user, const std::string &keyIn)
-
std::shared_ptr<StateKeyValue> getKV(const std::string &user, const std::string &key, size_t size)
-
std::shared_ptr<StateKeyValue> getKV(const std::string &user, const std::string &key)
-
void forceClearAll(bool global)
-
void deleteKV(const std::string &userIn, const std::string &keyIn)
-
void deleteKVLocally(const std::string &userIn, const std::string &keyIn)
-
size_t getKVCount()
-
std::string getThisIP()
Private Functions
-
std::shared_ptr<StateKeyValue> doGetKV(const std::string &user, const std::string &key, bool sizeless, size_t size)
Private Members
-
const std::string thisIP
-
std::unordered_map<std::string, std::shared_ptr<StateKeyValue>> kvMap
-
std::shared_mutex mapMutex
-
explicit State(std::string thisIPIn)
-
class State
-
namespace state