Logo
Explore Help
Sign In
gvsafronov/futriix-old
1
0
Fork 0
You've already forked futriix-old
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
futriix-old/tests/unit/moduleapi/scan.tcl

18 lines
427 B
Tcl
Raw Normal View History

Added scan implementation to module api. The implementation expose the following new functions: 1. RedisModule_CursorCreate - allow to create a new cursor object for keys scanning 2. RedisModule_CursorRestart - restart an existing cursor to restart the scan 3. RedisModule_CursorDestroy - destroy an existing cursor 4. RedisModule_Scan - scan keys The RedisModule_Scan function gets a cursor object, a callback and void* (used as user private data). The callback will be called for each key in the database proving the key name and the value as RedisModuleKey.
2019-10-17 15:37:01 +03:00
set testmodule [file normalize tests/modules/scan.so]
proc count_log_message {pattern} {
set result [exec grep -c $pattern < [srv 0 stdout]]
}
start_server {tags {"modules"}} {
r module load $testmodule
test {Module scan} {
# the module create a scan command which also return values
r set x 1
r set y 2
r set z 3
lsort [r scan.scankeysvalues]
} {{x 1} {y 2} {z 3}}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.4 Page: 533ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API