mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
feat: hook mode is changed to FIFO
Signed-off-by: monkey <golang@88.com>
This commit is contained in:
14
ring.go
14
ring.go
@ -509,12 +509,14 @@ func NewRing(opt *RingOptions) *Ring {
|
||||
ring.cmdsInfoCache = newCmdsInfoCache(ring.cmdsInfo)
|
||||
ring.cmdable = ring.Process
|
||||
|
||||
ring.hooks.setProcess(ring.process)
|
||||
ring.hooks.setProcessPipeline(func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, false)
|
||||
})
|
||||
ring.hooks.setProcessTxPipeline(func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, true)
|
||||
ring.hooks.setDefaultHook(defaultHook{
|
||||
process: ring.process,
|
||||
pipeline: func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, false)
|
||||
},
|
||||
txPipeline: func(ctx context.Context, cmds []Cmder) error {
|
||||
return ring.generalProcessPipeline(ctx, cmds, true)
|
||||
},
|
||||
})
|
||||
|
||||
go ring.sharding.Heartbeat(hbCtx, opt.HeartbeatFrequency)
|
||||
|
Reference in New Issue
Block a user