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

Method SetInitConnFunc

internal/pool/conn.go:642–644  ·  view source on GitHub ↗

SetInitConnFunc sets the connection initialization function to be called on reconnections.

(fn func(context.Context, *Conn) error)

Source from the content-addressed store, hash-verified

640
641// SetInitConnFunc sets the connection initialization function to be called on reconnections.
642func (cn *Conn) SetInitConnFunc(fn func(context.Context, *Conn) error) {
643 cn.initConnFunc = fn
644}
645
646// ExecuteInitConn runs the stored connection initialization function if available.
647func (cn *Conn) ExecuteInitConn(ctx context.Context) error {

Callers 3

TestConnectionHookFunction · 0.95
initConnMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestConnectionHookFunction · 0.76