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

Function ValidFromIdle

internal/pool/conn_state.go:62–64  ·  view source on GitHub ↗

Accessor functions for predefined slices to avoid allocations in external packages These return the same slice instance, so they're zero-allocation ValidFromIdle returns a predefined slice containing only StateIdle. Use this to avoid allocations when calling AwaitAndTransition or TryTransition.

()

Source from the content-addressed store, hash-verified

60// ValidFromIdle returns a predefined slice containing only StateIdle.
61// Use this to avoid allocations when calling AwaitAndTransition or TryTransition.
62func ValidFromIdle() []ConnState {
63 return validFromIdle
64}
65
66// ValidFromCreatedIdleOrUnusable returns a predefined slice for initialization transitions.
67// Use this to avoid allocations when calling AwaitAndTransition or TryTransition.

Callers 1

OnPutMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected