Remove Ring.consumers
We don't need to keep track of consumers anymore.
This commit is contained in:
parent
dd08acc3ea
commit
f4aa05af66
8
ring.go
8
ring.go
@ -11,9 +11,7 @@ import (
|
|||||||
type Ring struct {
|
type Ring struct {
|
||||||
buffer []*irc.Message
|
buffer []*irc.Message
|
||||||
cap uint64
|
cap uint64
|
||||||
|
cur uint64
|
||||||
cur uint64
|
|
||||||
consumers []*RingConsumer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRing creates a new ring buffer.
|
// 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
|
// The consumer will get messages starting from the specified history sequence
|
||||||
// number (see Ring.Cur).
|
// number (see Ring.Cur).
|
||||||
func (r *Ring) NewConsumer(seq uint64) *RingConsumer {
|
func (r *Ring) NewConsumer(seq uint64) *RingConsumer {
|
||||||
consumer := &RingConsumer{ring: r, cur: seq}
|
return &RingConsumer{ring: r, cur: seq}
|
||||||
r.consumers = append(r.consumers, consumer)
|
|
||||||
return consumer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RingConsumer is a ring buffer consumer.
|
// RingConsumer is a ring buffer consumer.
|
||||||
|
Loading…
Reference in New Issue
Block a user