Skip to content

Commit f77228d

Browse files
SoulPancakerueian
andauthored
feat: Update readme.md for rueidisaside for LuaLocking (#732)
* feat: Add Lua Locking for Redis < 7 Compatibility * feat: address comment * feat: add LuaLock flag to clientOption * feat: add tests for client with lua lock * feat: update readme for LuaLock usage in rueidisaside SET NX GET * Update README.md * feat: update from suggestions Co-authored-by: Rueian <[email protected]> --------- Co-authored-by: Anuragkillswitch <[email protected]> Co-authored-by: Rueian <[email protected]>
1 parent 5127a2c commit f77228d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

rueidisaside/README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,19 @@ func main() {
110110

111111
## Limitation
112112

113-
Currently, requires Redis >= 7.0.
113+
Currently, requires Redis >= 7.0.
114+
However, the `UseLuaLock` option is available and allows you to use the `rueidisaside` with older Redis versions < 7.0 as well.
115+
116+
To configure the Lua fallback option:
117+
118+
```go
119+
client, err := rueidisaside.NewClient(rueidisaside.ClientOption{
120+
ClientOption: rueidis.ClientOption{
121+
InitAddress: []string{"127.0.0.1:6379"},
122+
},
123+
UseLuaLock: true, // Enable Lua script for older Redis versions
124+
})
125+
if err != nil {
126+
panic(err)
127+
}
128+
```

0 commit comments

Comments
 (0)