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

Method Transition

internal/pool/conn_state.go:199–202  ·  view source on GitHub ↗

Transition unconditionally transitions to the target state. Use with caution - prefer AwaitAndTransition or TryTransition for safety. This is useful for error paths or when you know the transition is valid.

(targetState ConnState)

Source from the content-addressed store, hash-verified

197// Use with caution - prefer AwaitAndTransition or TryTransition for safety.
198// This is useful for error paths or when you know the transition is valid.
199func (sm *ConnStateMachine) Transition(targetState ConnState) {
200 sm.state.Store(uint32(targetState))
201 sm.notifyWaiters()
202}
203
204// AwaitAndTransition waits for the connection to reach one of the valid states,
205// then atomically transitions to the target state.

Calls 1

notifyWaitersMethod · 0.95