writeEvent writes the specified event to the Runtime's event channel. The event is discarded if no event channel has been registered (yet).
(event *Event)
| 49 | // writeEvent writes the specified event to the Runtime's event channel. The |
| 50 | // event is discarded if no event channel has been registered (yet). |
| 51 | func (r *Runtime) writeEvent(event *Event) { |
| 52 | select { |
| 53 | case r.eventChannel <- event: |
| 54 | // Done |
| 55 | case <-time.After(2 * time.Second): |
| 56 | // The Runtime's event channel has a buffer of size 100 which |
| 57 | // should be enough even under high load. However, we |
| 58 | // shouldn't block too long in case the buffer runs full (could |
| 59 | // be an honest user error or bug). |
| 60 | logrus.Warnf("Discarding libimage event which was not read within 2 seconds: %v", event) |
| 61 | } |
| 62 | } |
no outgoing calls
no test coverage detected