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

Function NewConnStateMachine

internal/pool/conn_state.go:130–136  ·  view source on GitHub ↗

NewConnStateMachine creates a new connection state machine. Initial state is StateCreated.

()

Source from the content-addressed store, hash-verified

128// NewConnStateMachine creates a new connection state machine.
129// Initial state is StateCreated.
130func NewConnStateMachine() *ConnStateMachine {
131 sm := &ConnStateMachine{
132 waiters: list.New(),
133 }
134 sm.state.Store(uint32(StateCreated))
135 return sm
136}
137
138// GetState returns the current state (lock-free read).
139// This is the hot path - optimized for zero allocations and minimal overhead.

Calls

no outgoing calls