Add Counter comments
This commit is contained in:
parent
0c93549fdf
commit
1c57066091
14
counter.go
14
counter.go
@ -9,12 +9,16 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
// Counter is responsible for operating queue read and write indexes
|
||||||
Counter struct {
|
Counter struct {
|
||||||
WriteIndex uint
|
WriteIndex uint // Number of the record last written to the queue
|
||||||
ReadIndex uint
|
ReadIndex uint // Number of the record last read from the queue
|
||||||
mutex sync.Mutex
|
// If WriteIndex is greater than ReadIndex then there are unread messages
|
||||||
stream chan uint
|
// If WriteIndex is less tham ReadIndex then MaxIndex was reached
|
||||||
streaming bool
|
|
||||||
|
mutex sync.Mutex
|
||||||
|
stream chan uint
|
||||||
|
streaming bool
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user