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

Method Next

consumergroup.go:701–712  ·  view source on GitHub ↗

Next waits for the next consumer group generation. There will never be two active generations. Next will never return a new generation until the previous one has completed. If there are errors setting up the next generation, they will be surfaced here. If the ConsumerGroup has been closed, then

(ctx context.Context)

Source from the content-addressed store, hash-verified

699//
700// If the ConsumerGroup has been closed, then Next will return ErrGroupClosed.
701func (cg *ConsumerGroup) Next(ctx context.Context) (*Generation, error) {
702 select {
703 case <-ctx.Done():
704 return nil, ctx.Err()
705 case <-cg.done:
706 return nil, ErrGroupClosed
707 case err := <-cg.errs:
708 return nil, err
709 case next := <-cg.next:
710 return next, nil
711 }
712}
713
714func (cg *ConsumerGroup) run() {
715 // the memberID is the only piece of information that is maintained across

Calls 2

DoneMethod · 0.80
ErrMethod · 0.45