Skip to content

Commit a2d75f5

Browse files
committed
chore: sync mocked pipe
Signed-off-by: Rueian <[email protected]>
1 parent af266d4 commit a2d75f5

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

mock/result.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,32 +185,30 @@ type pool struct {
185185

186186
type pipe struct {
187187
conn net.Conn
188-
error atomic.Pointer[errs]
189-
clhks atomic.Value // closed hook, invoked after the conn is closed
190-
pshks atomic.Pointer[pshks] // pubsub hook, registered by the SetPubSubHooks
188+
clhks atomic.Value // closed hook, invoked after the conn is closed
191189
queue any
192-
cache rueidis.CacheStore
190+
cache any
191+
pshks atomic.Pointer[pshks] // pubsub hook, registered by the SetPubSubHooks
192+
error atomic.Pointer[errs]
193193
r *bufio.Reader
194194
w *bufio.Writer
195195
close chan struct{}
196196
onInvalidations func([]rueidis.RedisMessage)
197-
r2psFn func() (p *pipe, err error) // func to build pipe for resp2 pubsub
198-
r2pipe *pipe // internal pipe for resp2 pubsub only
199-
ssubs *any // pubsub smessage subscriptions
200-
nsubs *any // pubsub message subscriptions
201-
psubs *any // pubsub pmessage subscriptions
202-
pingTimer *time.Timer
197+
ssubs *any // pubsub smessage subscriptions
198+
nsubs *any // pubsub message subscriptions
199+
psubs *any // pubsub pmessage subscriptions
200+
r2p *any
201+
pingTimer *time.Timer // timer for background ping
202+
lftmTimer *time.Timer // lifetime timer
203203
info map[string]rueidis.RedisMessage
204204
timeout time.Duration
205205
pinggap time.Duration
206206
maxFlushDelay time.Duration
207-
r2mu sync.Mutex
207+
lftm time.Duration // lifetime
208+
wrCounter atomic.Uint64
208209
version int32
209-
_ [10]int32
210210
blcksig int32
211211
state int32
212-
waits int32
213-
recvs int32
214212
bgState int32
215213
r2ps bool // identify this pipe is used for resp2 pubsub or not
216214
noNoDelay bool

0 commit comments

Comments
 (0)