// FlushOnTimeOut checks if timeout or slush count reached and flush in this case
343818
func (bwa *BatchedWriterAssembly) FlushOnTimeOut() {
	if bwa.Batch.ReachedTimeThreshold(bwa.config.BatchTimeout) || bwa.Batch.ReachedSizeThreshold(bwa.config.BatchFlushCount) {
		bwa.Flush()
	}
}
177755
func (ls *LightStepSpanSink) Flush() {
	ls.mutex.Lock()
	defer ls.mutex.Unlock()

	samples := &ssf.Samples{}
	defer metrics.Report(ls.traceClient, samples)

	totalCount := int64(0)

	ls.serviceCount.Range(func(keyI, valueI interface{}) bool {
		service, ok := keyI.(string)
		if !ok {
			ls.log.WithFields(logrus.Fields{
				"key":  keyI,
				"type": reflect.TypeOf(keyI),
			}).Error("Invalid key type in map when flushing Lightstep client")
			return true
		}

		value, ok := valueI.(*int64)
		if !ok {
			ls.log.WithFields(logrus.Fields{
				"value": valueI,
				"type":  reflect.TypeOf(valueI),
			}).Error("Invalid value type in map when flushing Lightstep client")
			return true
		}

		count := atomic.SwapInt64(value, 0)
		totalCount += count
		samples.Add(ssf.Count(sinks.MetricKeyTotalSpansFlushed, float32(count),
			map[string]string{"sink": ls.Name(), "service": service}))

		return true
	})

	ls.log.WithField("total_spans", totalCount).Debug("Checkpointing flushed spans for Lightstep")
}
521227
func (s *NodesStatsService) Timeout(timeout string) *NodesStatsService {
	s.timeout = timeout
	return s
}
1249125
func (s *PutScriptService) Timeout(timeout string) *PutScriptService {
	s.timeout = timeout
	return s
}
600399
func (b *UpdateService) Timeout(timeout string) *UpdateService {
	b.timeout = timeout
	return b
}
512629
func (axp *TxPool) SetTimeout(timeout time.Duration) {
	axp.timeout.Set(timeout)
	axp.ticks.SetInterval(timeout / 10)
}
622915
func (w *writerWithoutCloseNotify) Flush() {
	if f, ok := w.W.(http.Flusher); ok {
		f.Flush()
	}
}
1340142
func (m *Map) Flush() int {
	return doGC(m, &GCFilter{
		RemoveExpired: true,
		Time:          MaxTime,
	})
}
198931
func (s *ReindexService) Timeout(timeout string) *ReindexService {
	s.timeout = timeout
	return s
}
1102200
func (s *IngestPutPipelineService) Timeout(timeout string) *IngestPutPipelineService {
	s.timeout = timeout
	return s
}
969862
func (s *IndicesOpenService) Timeout(timeout string) *IndicesOpenService {
	s.timeout = timeout
	return s
}
41690
func Timeout(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "timeout", Listener: listener}
}
907524
func IsTimeout(err error) bool {
	if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
		return true
	}
	return false
}
875391
func IsTimeout(err error) bool {
	return isCausedBy(err, func(e error) bool { return e == context.DeadlineExceeded })
}
504588
func (s *UpdateByQueryService) Timeout(timeout string) *UpdateByQueryService {
	s.timeout = timeout
	return s
}
722168
func (cs *ConsensusState) scheduleTimeout(duration time.Duration, height int64, round int, step cstypes.RoundStepType) {
	cs.timeoutTicker.ScheduleTimeout(timeoutInfo{duration, height, round, step})
}
784779
func (s *SearchSource) Timeout(timeout string) *SearchSource {
	s.timeout = timeout
	return s
}