MCPcopy
hub / github.com/IBM/sarama / Close

Method Close

async_producer.go:556–579  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

554}
555
556func (p *asyncProducer) Close() error {
557 p.AsyncClose()
558
559 if p.conf.Producer.Return.Successes {
560 go withRecover(func() {
561 for range p.successes {
562 }
563 })
564 }
565
566 var pErrs ProducerErrors
567 if p.conf.Producer.Return.Errors {
568 for event := range p.errors {
569 pErrs = append(pErrs, event)
570 }
571 } else {
572 <-p.errors
573 }
574
575 if len(pErrs) > 0 {
576 return pErrs
577 }
578 return nil
579}
580
581func (p *asyncProducer) AsyncClose() {
582 go withRecover(p.shutdown)

Callers

nothing calls this directly

Calls 2

AsyncCloseMethod · 0.95
withRecoverFunction · 0.85

Tested by

no test coverage detected