MCPcopy
hub / github.com/grpc/grpc-go / ReadOnReady

Method ReadOnReady

internal/transport/readyreader/ready_reader.go:144–152  ·  view source on GitHub ↗
(bufSize int, pool mem.BufferPool)

Source from the content-addressed store, hash-verified

142}
143
144func (c *blockingReader) ReadOnReady(bufSize int, pool mem.BufferPool) (*[]byte, int, error) {
145 buf := pool.Get(bufSize)
146 n, err := c.reader.Read(*buf)
147 if err != nil {
148 pool.Put(buf)
149 return nil, 0, err
150 }
151 return buf, n, nil
152}
153
154// New detects if [syscall.RawConn] is available for non-memory-pinning reads.
155// If [syscall.RawConn] is unavailable, it falls back to using the simpler

Callers

nothing calls this directly

Calls 3

GetMethod · 0.65
ReadMethod · 0.65
PutMethod · 0.65

Tested by

no test coverage detected