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

Method MaybeHasData

internal/pool/conn.go:969–975  ·  view source on GitHub ↗

MaybeHasData tries to peek at the next byte in the socket without consuming it This is used to check if there are push notifications available Important: This will work on Linux, but not on Windows

()

Source from the content-addressed store, hash-verified

967// This is used to check if there are push notifications available
968// Important: This will work on Linux, but not on Windows
969func (cn *Conn) MaybeHasData() bool {
970 // Lock-free netConn access for better performance
971 if netConn := cn.getNetConn(); netConn != nil {
972 return maybeHasData(netConn)
973 }
974 return false
975}
976
977// deadline computes the effective deadline time based on context and timeout.
978// It updates the usedAt timestamp to now.

Callers 1

Calls 2

getNetConnMethod · 0.95
maybeHasDataFunction · 0.70

Tested by

no test coverage detected