using TCC for MSetNX in cluster

This commit is contained in:
hdt3213
2022-04-08 20:28:13 +08:00
parent e2a1bbbe7d
commit c97f3aae6e
9 changed files with 150 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ type CmdLine = [][]byte
// DB is the interface for redis style storage engine
type DB interface {
Exec(client redis.Connection, args [][]byte) redis.Reply
Exec(client redis.Connection, cmdLine [][]byte) redis.Reply
AfterClientClose(c redis.Connection)
Close()
}
@@ -18,7 +18,7 @@ type DB interface {
// EmbedDB is the embedding storage engine exposing more methods for complex application
type EmbedDB interface {
DB
ExecWithLock(conn redis.Connection, args [][]byte) redis.Reply
ExecWithLock(conn redis.Connection, cmdLine [][]byte) redis.Reply
ExecMulti(conn redis.Connection, watching map[string]uint32, cmdLines []CmdLine) redis.Reply
GetUndoLogs(dbIndex int, cmdLine [][]byte) []CmdLine
ForEach(dbIndex int, cb func(key string, data *DataEntity, expiration *time.Time) bool)