Skip to content

Commit

Permalink
feat: Update readme.md for rueidisaside for LuaLocking (#732)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Feb 2, 2025
1 parent 5127a2c commit f77228d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion rueidisaside/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,19 @@ func main() {

## Limitation

Currently, requires Redis >= 7.0.
Currently, requires Redis >= 7.0.
However, the `UseLuaLock` option is available and allows you to use the `rueidisaside` with older Redis versions < 7.0 as well.

To configure the Lua fallback option:

```go
client, err := rueidisaside.NewClient(rueidisaside.ClientOption{
ClientOption: rueidis.ClientOption{
InitAddress: []string{"127.0.0.1:6379"},
},
UseLuaLock: true, // Enable Lua script for older Redis versions
})
if err != nil {
panic(err)
}
```

0 comments on commit f77228d

Please sign in to comment.