Add an event in the queue. If it has already l elements, the first element is dropped before adding the new m element
(m Event)
| 29 | // Add an event in the queue. If it has already l elements, the first |
| 30 | // element is dropped before adding the new m element |
| 31 | func (q *Queue) Add(m Event) { |
| 32 | for len(q.Queue) > q.L { //we allow to add one element more than the true capacity |
| 33 | q.Queue = q.Queue[1:] |
| 34 | } |
| 35 | q.Queue = append(q.Queue, m) |
| 36 | } |
| 37 | |
| 38 | // GetQueue returns the entire queue |
| 39 | func (q *Queue) GetQueue() []Event { |
no outgoing calls