// Called in order to flush all output's associated with the logger.
193711
func (b *backgroundFlusher) Process() {
	b.logger.outputMutex.RLock()
	defer b.logger.outputMutex.RUnlock()

	for _, o := range b.logger.outputs {
		o.OutputWrapper.Output.Flush()
	}
	if b.updateChan != nil {
		close(b.updateChan)
	}
}
364109
func (s *FloatEncoder) Flush() {
	if !s.finished {
		// write an end-of-stream record
		s.finished = true
		s.Write(math.NaN())
		s.bw.Flush(bitstream.Zero)
	}
}
600651
func (evc *EventCache) Flush() {
	for _, ei := range evc.events {
		evc.evsw.FireEvent(ei.event, ei.data)
	}
	// Clear the buffer, since we only add to it with append it's safe to just set it to nil and maybe safe an allocation
	evc.events = nil
}
688199
func (p *BulkProcessor) Flush() error {
	p.statsMu.Lock()
	p.stats.Flushed++
	p.statsMu.Unlock()

	for _, w := range p.workers {
		w.flushC <- struct{}{}
		<-w.flushAckC // wait for completion
	}
	return nil
}
1304862
func (l *FileLogger) output(msg *Message) {
	if l.mode == ROTATE && l.curLines >= l.maxLines && !l.errored {
		err := l.rotate()
		if err != nil {
			// if we can't rotate the logs, we should stop logging to prevent the log file from growing
			// past the limit and continuously retrying the rotate operation (but log current msg first)
			l.printLog(msg)
			l.printLog(&Message{len(l.levels) - 1, fmt.Sprintf("Error rotating logs: %s. Closing log."), time.Now()})
			l.errored = true
			l.close()
		}
	}
	l.printLog(msg)
}
957770
func (c *syncClient) Flushall() (err Error) {
	_, err = c.conn.ServiceRequest(&FLUSHALL, [][]byte{})
	return
}
659867
func (h *Handler) flush(batch *batch.Batch) {
	size := batch.Size()
	if err := batch.Flush(); err != nil {
		stdlog.Printf("log/elastic: failed to flush %d logs: %s", size, err)
	}
}
214252
func (t *LoggerType) Close() (err error) {
	t.flush(t.options.FlushTimeout)
	t.cancel()
	return t.eg.Wait()
}
631940
func (log *logCache) Flush(writer io.Writer) {
	log.flushing.Lock()
	defer log.flushing.Unlock()

	for _, message := range log.messages {
		writer.Write(message)
	}
	log.messages = [][]byte{}
}
408899
func Flush() error {
	update_size_maybe()
	prepare_diff_messages()
	for _, diff := range diffbuf {
		r := small_rect{
			left:   0,
			top:    diff.pos,
			right:  term_size.x - 1,
			bottom: diff.pos + diff.lines - 1,
		}
		write_console_output(out, diff.chars, r)
	}
	if !is_cursor_hidden(cursor_x, cursor_y) {
		move_cursor(cursor_x, cursor_y)
	}
	return nil
}
295437
func (fs *FileSessionStore) Flush() {
	fs.lock.Lock()
	defer fs.lock.Unlock()
	fs.values = make(map[interface{}]interface{})
}
283811
func (rm *responseModifier) Flush() {
	flusher, ok := rm.rw.(http.Flusher)
	if !ok {
		logrus.Error("Internal response writer doesn't support the Flusher interface")
		return
	}

	rm.FlushAll()
	flusher.Flush()
}
1247189
func (sl *DiskSessionLogger) flush() error {
	var err, err2 error

	if sl.RecordSessions && sl.chunksFile != nil {
		err = sl.chunksFile.Flush()
	}
	if sl.eventsFile != nil {
		err2 = sl.eventsFile.Flush()
	}
	return trace.NewAggregate(err, err2)
}
615371
func (cache *Cache) Flush(output Writer, backend Reader) error {
	err := cache.Sync(output)
	if err != nil {
		return err
	}
	cache.Reset(backend)
	return nil
}
797687
func (d *Datastore) Flush() error {
	b, err := d.child.Batch()
	if err != nil {
		return err
	}

	for k, o := range d.buffer {
		var err error
		if o.delete {
			err = b.Delete(k)
			if err == ds.ErrNotFound {
				// Ignore these, let delete be idempotent.
				err = nil
			}
		} else {
			err = b.Put(k, o.value)
		}
		if err != nil {
			return err
		}
	}
	// clear out buffer
	d.buffer = make(map[ds.Key]op, d.maxBufferEntries)

	return b.Commit()
}
1140023
func (l *logger) flush() (err error) {
	path := filepath.Join(os.TempDir(), "q")
	f, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
	if err != nil {
		return fmt.Errorf("failed to open %q: %v", path, err)
	}
	defer func() {
		if cerr := f.Close(); err == nil {
			err = cerr
		}
		l.lastWrite = time.Now()
	}()

	_, err = io.Copy(f, &l.buf)
	l.buf.Reset()
	if err != nil {
		return fmt.Errorf("failed to flush q buffer: %v", err)
	}

	return nil
}
334387
func (logger *Logger) ResetOutput() {
	logger.outputMutex.Lock()
	logger.outputs = make([]*loggerOutputWrapper, 0)
	logger.outputMutex.Unlock()
}