MCPcopy
hub / github.com/segmentio/kafka-go / Read

Method Read

conn.go:709–713  ·  view source on GitHub ↗

Read reads the message at the current offset from the connection, advancing the offset on success so the next call to a read method will produce the next message. The method returns the number of bytes read, or an error if something went wrong. While it is safe to call Read concurrently from multip

(b []byte)

Source from the content-addressed store, hash-verified

707// This method is provided to satisfy the net.Conn interface but is much less
708// efficient than using the more general purpose ReadBatch method.
709func (c *Conn) Read(b []byte) (int, error) {
710 batch := c.ReadBatch(1, len(b))
711 n, err := batch.Read(b)
712 return n, coalesceErrors(silentEOF(err), batch.Close())
713}
714
715// ReadMessage reads the message at the current offset from the connection,
716// advancing the offset on success so the next call to a read method will

Callers 1

TestMessageFixturesFunction · 0.45

Calls 4

ReadBatchMethod · 0.95
coalesceErrorsFunction · 0.85
silentEOFFunction · 0.85
CloseMethod · 0.45

Tested by 1

TestMessageFixturesFunction · 0.36