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)
| 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. |
| 199 | func (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. |