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

Method IsUsed

internal/pool/conn.go:356–358  ·  view source on GitHub ↗

IsUsed returns true if the connection is currently in use (lock-free). Deprecated: Use GetStateMachine().GetState() == StateInUse directly for better clarity. This method is kept for backwards compatibility. A connection is "used" when it has been retrieved from the pool and is actively processing

()

Source from the content-addressed store, hash-verified

354// actively processing a command. Background operations (like re-auth) should
355// wait until the connection is not used before executing commands.
356func (cn *Conn) IsUsed() bool {
357 return cn.stateMachine.GetState() == StateInUse
358}
359
360// SetUsed sets the used flag for the connection (lock-free).
361//

Callers 1

TestConn_UsedMethodsFunction · 0.95

Calls 1

GetStateMethod · 0.45

Tested by 1

TestConn_UsedMethodsFunction · 0.76