4#define REDIS_RESULT_BUFFER_SIZE (10 * 1024)
84 LOGI(
"RedisBuffer:writeArray: %d", len);
87 for (
int i = 0; i < len; ++i) {
106 LOGI(
"RedisBuffer:read: no data available");
127 while (read_count < len) {
149 if (!
resp.ok)
return false;
150 result = (
T)
resp.intValue;
162 LOGI(
"Redis DEL: %d",
rc.intValue);
209 LOGI(
"RedisBuffer::resize: %d",
size);
251 (
arg3.length() > 0)) +
253 out +=
"$" +
String(cmd.length()) +
"\r\n" + cmd +
"\r\n";
271 LOGE(
"Redis not connected");
298 String tail = (
char*)buffer;
299 int nl_pos = tail.indexOf(
"\r\n");
302 if (!head.startsWith(
"$"))
304 tail = tail.substring(
nl_pos + 2);
306 nl_pos = tail.indexOf(
"\r\n");
309 if (!tail.startsWith(
"$") && tail.length() > 0) {
321 if (
line.startsWith(
"$")) {
322 int end =
line.indexOf(
"\n");
327 if (
line.startsWith(
":")) {
328 line.replace(
":",
"");
331 if (
line.startsWith(
"-")){
356 cmd +=
"$5\r\nRPUSH\r\n";
372 LOGI(
"Redis EXPIRE: %d (ok=%d)",
resp.intValue,
resp.ok);
388 LOGE(
"Redis LPOP failed: %s", cmd.c_str());
391 for (
auto& str :
rc.strValues) {
392 if (str.startsWith(
"*"))
continue;
393 if (str.startsWith(
"$"))
continue;
394 if (str.length() == 0)
continue;
395 LOGI(
"- %s", str.c_str());
396 T value = (
T)str.toInt();
403 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:4