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

Method Write

conn.go:1100–1102  ·  view source on GitHub ↗

Write writes a message to the kafka broker that this connection was established to. The method returns the number of bytes written, or an error if something went wrong. The operation either succeeds or fail, it never partially writes the message. This method is exposed to satisfy the net.Conn inte

(b []byte)

Source from the content-addressed store, hash-verified

1098// This method is exposed to satisfy the net.Conn interface but is less efficient
1099// than the more general purpose WriteMessages method.
1100func (c *Conn) Write(b []byte) (int, error) {
1101 return c.WriteCompressedMessages(nil, Message{Value: b})
1102}
1103
1104// WriteMessages writes a batch of messages to the connection's topic and
1105// partition, returning the number of bytes written. The write is an atomic

Callers 10

TestMessageCRC32Function · 0.45
BalanceMethod · 0.45
BalanceMethod · 0.45
bytesMethod · 0.45
bytesMethod · 0.45
bytesMethod · 0.45
bytesMethod · 0.45
saslAuthenticateMethod · 0.45
writeToMethod · 0.45
producerHandlerFunction · 0.45

Calls 1

Tested by 5

TestMessageCRC32Function · 0.36
bytesMethod · 0.36
bytesMethod · 0.36
bytesMethod · 0.36
bytesMethod · 0.36