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

Method spawn

writer.go:543–549  ·  view source on GitHub ↗

spawn starts a new asynchronous operation on the writer. This method is used instead of starting goroutines inline to help manage the state of the writer's wait group. The wait group is used to block Close calls until all inflight operations have completed, therefore automatically including those st

(f func())

Source from the content-addressed store, hash-verified

541// inflight operations have completed, therefore automatically including those
542// started with calls to spawn.
543func (w *Writer) spawn(f func()) {
544 w.group.Add(1)
545 go func() {
546 defer w.group.Done()
547 f()
548 }()
549}
550
551// Close flushes pending writes, and waits for all writes to complete before
552// returning. Calling Close also prevents new writes from being submitted to

Callers 2

newPartitionWriterFunction · 0.80
newWriteBatchMethod · 0.80

Calls 1

DoneMethod · 0.80

Tested by

no test coverage detected