Add Pause/Resume #18

Open
zeripath wants to merge 2 commits from zeripath/log:add-pausing into master
zeripath commented 2 years ago
Owner

Add Pause/Resume functionality to the log.

The timeout here probably needs to change - possibly to something like 10 * time.Millisecond in order to cope with buffer filling during being paused.

// LogEvent logs an event to this MultiChannelledLog
func (m *MultiChannelledLog) LogEvent(event *Event) error {
	select {
	case m.queue <- event:
		return nil
	case <-time.After(60 * time.Second):
		// We're blocked!
		return ErrTimeout{
			Name:     m.name,
			Provider: "MultiChannelledLog",
		}
	}
}

Signed-off-by: Andrew Thornton art27@cantab.net

Add Pause/Resume functionality to the log. The timeout here probably needs to change - possibly to something like `10 * time.Millisecond` in order to cope with buffer filling during being paused. ```go // LogEvent logs an event to this MultiChannelledLog func (m *MultiChannelledLog) LogEvent(event *Event) error { select { case m.queue <- event: return nil case <-time.After(60 * time.Second): // We're blocked! return ErrTimeout{ Name: m.name, Provider: "MultiChannelledLog", } } } ``` Signed-off-by: Andrew Thornton <art27@cantab.net>
Owner

CI needs goproxy

CI needs goproxy
Poster
Owner

See #19

See #19
Owner

Why we needs to pause the logger?

Why we needs to pause the logger?
All checks were successful
continuous-integration/drone/pr Build is passing
This Pull Request doesn't have enough approvals yet. 0 of 2 approvals granted.
Sign in to join this conversation.
Loading…
There is no content yet.