Push pushes a new event to the channel. Prior to sending the event to the channel, all registered listeners are invoked. The event is sent to the channel if one of the listeners agrees so and no errors are thrown. If the event depends on the state of subsequent events, then we store it in the backlo
(e *Event)
| 107 | // enriched with callstack parameter and forwarded to the |
| 108 | // event queue. |
| 109 | func (q *Queue) Push(e *Event) error { |
| 110 | if q.stackEnrichment { |
| 111 | // store pending event for callstack enrichment |
| 112 | if e.Type.CanEnrichStack() { |
| 113 | q.decorator.Push(e) |
| 114 | return nil |
| 115 | } |
| 116 | // decorate events with callstack return addresses |
| 117 | if e.IsStackWalk() { |
| 118 | e = q.decorator.Pop(e) |
| 119 | } |
| 120 | } |
| 121 | // drop stack walk events |
| 122 | if e.IsStackWalk() { |
| 123 | return nil |
| 124 | } |
| 125 | return q.push(e) |
| 126 | } |
| 127 | |
| 128 | func (q *Queue) push(e *Event) error { |
| 129 | var enqueue bool |