code: func (rs *retryingSink) Write(events ...Event) error {
  	rs.mu.Lock()
  	defer rs.mu.Unlock()
  
  retry:
  
  	if rs.closed {
  		return ErrSinkClosed
  	}
  
  	if !rs.proceed() {
  		logrus.Warnf("%v encountered too many errors, backing off", rs.sink)
  		rs.wait(rs.failures.backoff)
  		goto retry
  	}
  
  	if err := rs.write(events...); err != nil {
  		if err == ErrSinkClosed {
  			// terminal!
  			return err
  		}
  
  		logrus.Errorf("retryingsink: error writing events: %v, retrying", err)
  		goto retry
  	}
  
  	return nil
  }
docs: // Write attempts to flush the events to the downstream sink until it succeeds
  // or the sink is closed.