5#define REDIS_RESULT_BUFFER_SIZE (10 * 1024)
87 LOGI(
"RedisBuffer:writeArray: %d", len);
90 for (
int i = 0; i < len; ++i) {
109 LOGI(
"RedisBuffer:read: no data available");
152 if (!
resp.ok)
return false;
153 result = (
T)
resp.intValue;
165 LOGI(
"Redis DEL: %d",
rc.intValue);
212 LOGI(
"RedisBuffer::resize: %d",
size);
254 (
arg3.length() > 0)) +
256 out +=
"$" +
String(cmd.length()) +
"\r\n" + cmd +
"\r\n";
274 LOGE(
"Redis not connected");
301 String tail = (
char*)buffer;
302 int nl_pos = tail.indexOf(
"\r\n");
306 tail = tail.substring(
nl_pos + 2);
308 nl_pos = tail.indexOf(
"\r\n");
311 if (!tail.startsWith(
"$") && tail.length() > 0) {
323 if (
line.startsWith(
"$")) {
324 int end =
line.indexOf(
"\n");
329 if (
line.startsWith(
":")) {
330 line.replace(
":",
"");
333 if (
line.startsWith(
"-")) {
337 if (
line.isEmpty()) {
357 cmd +=
"$5\r\nRPUSH\r\n";
373 LOGI(
"Redis EXPIRE: %d (ok=%d)",
resp.intValue,
resp.ok);
389 LOGE(
"Redis LPOP failed: %s", cmd.c_str());
392 for (
auto& str :
rc.strValues) {
393 if (str.startsWith(
"*"))
continue;
394 if (str.startsWith(
"$"))
continue;
395 if (str.length() == 0)
continue;
396 LOGI(
"- %s", str.c_str());
397 T value = (
T)str.toInt();
405 LOGW(
"RedisBuffer:fillReadBuffer: not enough data read from Redis");
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define REDIS_RESULT_BUFFER_SIZE
Definition RedisBuffer.h:5
bool connected()
Definition Arduino.h:167
virtual int read(uint8_t *buffer, size_t len)
Definition Arduino.h:165
virtual void flush()
Definition Arduino.h:130
virtual int available()
Definition Arduino.h:139