func (w *FlushingWriter) Write(data []byte) (written int, err error) {
	w.writeMutex.Lock()
	defer w.writeMutex.Unlock()
	w.wrote = true
	written, err = w.ResponseWriter.Write(data)
	if err != nil {
		return
	}
	if f, ok := w.ResponseWriter.(http.Flusher); ok {
		defer func() {
			if r := recover(); r != nil {
				msg := fmt.Sprintf("Error recovered on flushing writer: %#v", r)
				log.Debugf(msg)
				err = errors.Errorf(msg)
			}
		}()
		f.Flush()
	}
	return
}
func (w *FlushingWriter) Write(data []byte) (written int, err error) {
	w.writeMutex.Lock()
	defer w.writeMutex.Unlock()
	w.wrote = true
	written, err = w.ResponseWriter.Write(data)
	if err != nil {
		return
	}
	if f, ok := w.ResponseWriter.(http.Flusher); ok {
		defer func() {
			if r := recover(); r != nil {
				msg := fmt.Sprintf("Error recovered on flushing writer: %#v", r)
				log.Debugf(msg)
				err = errors.Errorf(msg)
			}
		}()
		f.Flush()
	}
	return
}
func ( w * FlushingWriter ) Write ( data [ ] byte ) ( written int , err error ) { w . writeMutex . Lock ( ) defer w . writeMutex . Unlock ( ) w . wrote = true written , err = w . ResponseWriter . Write ( data ) if err != nil { return } if f , ok := w . ResponseWriter . ( http . Flusher ) ; ok { defer func ( ) { if r := recover ( ) ; r != nil { msg := fmt . Sprintf ( " " , r ) log . Debugf ( msg ) err = errors . Errorf ( msg ) } } ( ) f . Flush ( ) } return }
// Write writes and flushes the data.
Write writes and flushes the data .