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

Method newWriteBatch

writer.go:1066–1070  ·  view source on GitHub ↗

ptw.w can be accessed here because this is called with the lock ptw.mutex already held.

()

Source from the content-addressed store, hash-verified

1064
1065// ptw.w can be accessed here because this is called with the lock ptw.mutex already held.
1066func (ptw *partitionWriter) newWriteBatch() *writeBatch {
1067 batch := newWriteBatch(time.Now(), ptw.w.batchTimeout())
1068 ptw.w.spawn(func() { ptw.awaitBatch(batch) })
1069 return batch
1070}
1071
1072// awaitBatch waits for a batch to either fill up or time out.
1073// If the batch is full it only stops the timer, if the timer

Callers 1

writeMessagesMethod · 0.95

Calls 4

awaitBatchMethod · 0.95
newWriteBatchFunction · 0.85
batchTimeoutMethod · 0.80
spawnMethod · 0.80

Tested by

no test coverage detected