NewQueue constructs a new queue with the given channel size.
(size int, stackEnrichment bool, enqueueAlways bool)
| 52 | |
| 53 | // NewQueue constructs a new queue with the given channel size. |
| 54 | func NewQueue(size int, stackEnrichment bool, enqueueAlways bool) *Queue { |
| 55 | q := &Queue{ |
| 56 | q: make(chan *Event, size), |
| 57 | listeners: make([]Listener, 0), |
| 58 | stackEnrichment: stackEnrichment, |
| 59 | enqueueAlways: enqueueAlways, |
| 60 | } |
| 61 | q.decorator = NewStackwalkDecorator(q) |
| 62 | return q |
| 63 | } |
| 64 | |
| 65 | // NewQueueWithChannel constructs a new queue with a custom channel. |
| 66 | func NewQueueWithChannel(ch chan *Event, stackEnrichment bool, enqueueAlways bool) *Queue { |