File StateClient.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 StateClient : public faabric::transport::MessageEndpointClient

Public Functions

explicit StateClient(const std::string &userIn, const std::string &keyIn, const std::string &hostIn)
void pushChunks(const std::vector<StateChunk> &chunks)
void pullChunks(const std::vector<StateChunk> &chunks, uint8_t *bufferStart)
void append(const uint8_t *data, size_t length)
void pullAppended(uint8_t *buffer, size_t length, long nValues)
void clearAppended()
size_t stateSize()
void deleteState()
void lock()
void unlock()

Public Members

const std::string user
const std::string key

Private Functions

void sendStateRequest(faabric::state::StateCalls header, const uint8_t *data, int length)
void logRequest(const std::string &op)