NewConnStateMachine creates a new connection state machine. Initial state is StateCreated.
()
| 128 | // NewConnStateMachine creates a new connection state machine. |
| 129 | // Initial state is StateCreated. |
| 130 | func 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. |
no outgoing calls