1
0
Fork 0

Add Counter comments

This commit is contained in:
Gregory Eremin 2014-07-16 02:41:38 +07:00
parent 0c93549fdf
commit 1c57066091
1 changed files with 9 additions and 5 deletions

View File

@ -9,12 +9,16 @@ const (
)
type (
// Counter is responsible for operating queue read and write indexes
Counter struct {
WriteIndex uint
ReadIndex uint
mutex sync.Mutex
stream chan uint
streaming bool
WriteIndex uint // Number of the record last written to the queue
ReadIndex uint // Number of the record last read from the queue
// If WriteIndex is greater than ReadIndex then there are unread messages
// If WriteIndex is less tham ReadIndex then MaxIndex was reached
mutex sync.Mutex
stream chan uint
streaming bool
}
)