Remove Ring.consumers

We don't need to keep track of consumers anymore.
This commit is contained in:
Simon Ser 2020-04-07 14:46:31 +02:00
parent dd08acc3ea
commit f4aa05af66
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -11,9 +11,7 @@ import (
type Ring struct {
buffer []*irc.Message
cap uint64
cur uint64
consumers []*RingConsumer
}
// NewRing creates a new ring buffer.
@ -41,9 +39,7 @@ func (r *Ring) Cur() uint64 {
// The consumer will get messages starting from the specified history sequence
// number (see Ring.Cur).
func (r *Ring) NewConsumer(seq uint64) *RingConsumer {
consumer := &RingConsumer{ring: r, cur: seq}
r.consumers = append(r.consumers, consumer)
return consumer
return &RingConsumer{ring: r, cur: seq}
}
// RingConsumer is a ring buffer consumer.