MCPcopy
hub / github.com/rs/zerolog / Next

Method Next

diode/internal/diodes/poller.go:58–71  ·  diode/internal/diodes/poller.go::Poller.Next

Next polls the diode until data is available or until the context is done. If the context is done, then nil will be returned.

()

Source from the content-addressed store, hash-verified

56// Next polls the diode until data is available or until the context is done.
57// If the context is done, then nil will be returned.
58func (p *Poller) Next() GenericDataType {
59 for {
60 data, ok := p.Diode.TryNext()
61 if !ok {
62 if p.isDone() {
63 return nil
64 }
65
66 time.Sleep(p.interval)
67 continue
68 }
69 return data
70 }
71}
72
73func (p *Poller) isDone() bool {
74 select {

Callers

nothing calls this directly

Calls 2

isDoneMethod · 0.95
TryNextMethod · 0.65

Tested by

no test coverage detected