MCPcopy
hub / github.com/redis/go-redis / ShouldHandoff

Method ShouldHandoff

internal/pool/conn.go:396–401  ·  view source on GitHub ↗

Handoff state management - atomic access to handoff metadata ShouldHandoff returns true if connection needs handoff (lock-free).

()

Source from the content-addressed store, hash-verified

394
395// ShouldHandoff returns true if connection needs handoff (lock-free).
396func (cn *Conn) ShouldHandoff() bool {
397 if v := cn.handoffStateAtomic.Load(); v != nil {
398 return v.(*HandoffState).ShouldHandoff
399 }
400 return false
401}
402
403// GetHandoffEndpoint returns the new endpoint for handoff (lock-free).
404func (cn *Conn) GetHandoffEndpoint() string {

Callers 8

TestConnectionHookFunction · 0.95
MarkForHandoffMethod · 0.95
MarkQueuedForHandoffMethod · 0.95
releaseConnMethod · 0.80
reconnectMethod · 0.80
OnGetMethod · 0.80
OnPutMethod · 0.80

Calls 1

LoadMethod · 0.45

Tested by 2

TestConnectionHookFunction · 0.76