Push adds a new item to the queue
(item Datapoint)
| 41 | |
| 42 | // Push adds a new item to the queue |
| 43 | func (q *Queue) Push(item Datapoint) { |
| 44 | if len(q.items) >= q.size { |
| 45 | // Remove the first item (FIFO) |
| 46 | q.items = q.items[1:] |
| 47 | } |
| 48 | q.items = append(q.items, item) |
| 49 | } |
| 50 | |
| 51 | func (q *Queue) IsFull() bool { |
| 52 | return len(q.items) == q.size |
no outgoing calls