package readyreader

Import Path
	google.golang.org/grpc/internal/transport/readyreader (on go.dev)

Dependency Relation
	imports 4 packages, and imported by one package

Involved Source Files raw_conn_linux.go Package readyreader provides utilities to perform non-memory-pinning reads.
Package-Level Type Names (total 6, in which 1 is exported)
/* sort exporteds by: | */
Reader is an optional interface that can be implemented by [net.Conn] implementations to enable gRPC to perform non-memory-pinning reads. ReadOnReady waits for data to arrive, fetches a buffer, and performs a read. When the underlying IO is readable, it allocates a buffer of size bufSize from the pool and reads up to bufSize bytes into the buffer. It returns a pointer to the buffer so it can be returned to the pool later, the number of bytes read, and an error. Callers should always process the n > 0 bytes returned before considering the error. Doing so correctly handles I/O errors that happen after reading some bytes, as well as both of the allowed EOF behaviors. func New(r io.Reader) Reader func NewNonBlocking(r io.Reader) Reader func NewBuffered(rd Reader, size int, pool mem.BufferPool) io.Reader
Package-Level Functions (total 6, in which 3 are exported)
New detects if [syscall.RawConn] is available for non-memory-pinning reads. If [syscall.RawConn] is unavailable, it falls back to using the simpler [io.Reader] interface for reads.
NewBuffered returns a new [io.Reader] with a buffer of the specified size which is allocated from the provided pool.
NewNonBlocking returns a ReadyReader if the passed reader supports non-memory-pinning reads, else nil.