Run consumes events that have been queued for this EventQueue. It is presumed that the eventQueue is a buffered channel with a length of one (i.e., only one event can be processed at a time). All business logic for handling queued events is contained within this function. The events in the queue mus
()
| 220 | // cancelled; any event which is currently being processed will not be |
| 221 | // cancelled. |
| 222 | func (q *EventQueue) Run() { |
| 223 | if q.notSafeToAccess() { |
| 224 | return |
| 225 | } |
| 226 | |
| 227 | go q.run() |
| 228 | } |
| 229 | |
| 230 | func (q *EventQueue) run() { |
| 231 | q.eventQueueOnce.Do(func() { |