You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update outdated commands descriptions and cleanups in README (redis#11372)
Redis commands has been significantly refactored in 7.0.
This PR updates the outdated README.md to reflect it.
Based on redis#10864, doing some additional cleanups.
Co-authored-by: theoboldalex <theoboldalex@gmail.com>
Co-authored-by: Oran Agra <oran@redislabs.com>
Copy file name to clipboardExpand all lines: README.md
+26-23
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,9 @@ When you update the source code with `git pull` or when code inside the
75
75
dependencies tree is modified in any other way, make sure to use the following
76
76
command in order to really clean everything and rebuild from scratch:
77
77
78
-
make distclean
78
+
% make distclean
79
79
80
-
This will clean: jemalloc, lua, hiredis, linenoise.
80
+
This will clean: jemalloc, lua, hiredis, linenoise and other dependencies.
81
81
82
82
Also if you force certain build options like 32bit target, no C compiler
83
83
optimizations (for debugging purposes), and other similar build time options,
@@ -319,13 +319,17 @@ As you can see in the client structure above, arguments in a command
319
319
are described as `robj` structures. The following is the full `robj`
320
320
structure, which defines a *Redis object*:
321
321
322
-
typedef struct redisObject {
323
-
unsigned type:4;
324
-
unsigned encoding:4;
325
-
unsigned lru:LRU_BITS; /* lru time (relative to server.lruclock) */
326
-
int refcount;
327
-
void *ptr;
328
-
} robj;
322
+
```c
323
+
struct redisObject {
324
+
unsigned type:4;
325
+
unsigned encoding:4;
326
+
unsigned lru:LRU_BITS; /* LRU time (relative to global lru_clock) or
327
+
* LFU data (least significant 8 bits frequency
328
+
* and most significant 16 bits access time). */
329
+
int refcount;
330
+
void *ptr;
331
+
};
332
+
```
329
333
330
334
Basically this structure can represent all the basic Redis data types like
331
335
strings, lists, sets, sorted sets and so forth. The interesting thing is that
@@ -451,8 +455,9 @@ replicas, or to continue the replication after a disconnection.
451
455
452
456
Script
453
457
---
454
-
The script unit is compose of 3 units
455
-
*`script.c` - integration of scripts with Redis (commands execution, set replication/resp, ..)
458
+
459
+
The script unit is composed of 3 units:
460
+
*`script.c` - integration of scripts with Redis (commands execution, set replication/resp, ...)
456
461
*`script_lua.c` - responsible to execute Lua code, uses script.c to interact with Redis from within the Lua code.
457
462
*`function_lua.c` - contains the Lua engine implementation, uses script_lua.c to execute the Lua code.
458
463
*`functions.c` - contains Redis Functions implementation (FUNCTION command), uses functions_lua.c if the function it wants to invoke needs the Lua engine.
@@ -476,24 +481,22 @@ Anatomy of a Redis command
476
481
477
482
All the Redis commands are defined in the following way:
478
483
479
-
void foobarCommand(client *c) {
480
-
printf("%s",c->argv[1]->ptr); /* Do something with the argument. */
481
-
addReply(c,shared.ok); /* Reply something to the client. */
482
-
}
483
-
484
-
The command is then referenced inside `server.c` in the command table:
0 commit comments