// timeoutRoutine: receive requests for timeouts on tickChan and fire timeouts on tockChan
// receiveRoutine: serializes processing of proposoals, block parts, votes; coordinates state transitions
515559
func (cs *ConsensusState) startRoutines(maxSteps int) {
	err := cs.timeoutTicker.Start()
	if err != nil {
		cs.Logger.Error("Error starting timeout ticker", "err", err)
		return
	}
	go cs.receiveRoutine(maxSteps)
}
1038251
func Timeout(duration time.Duration) Option {
	return func(r *NBReader) {
		r.forceTimeout = duration
	}
}
163908
func (s *IndicesRolloverService) Timeout(timeout string) *IndicesRolloverService {
	s.timeout = timeout
	return s
}
595434
func (s *IndicesShrinkService) Timeout(timeout string) *IndicesShrinkService {
	s.timeout = timeout
	return s
}
724499
func (pool *Pool) Timeout(timeout time.Duration) *Pool {
	pool.conf.Timeout = timeout
	return &Pool{redis: pool.redis, conf: pool.conf}
}
1172642
func RouterMiddlewareTimeout(timeout time.Duration) RouterMiddleware {
	return func(h httprouter.Handle) httprouter.Handle {
		return func(rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
			handleTimeout(timeout, rw, func() { h(rw, r, p) })
		}
	}
}
854844
func (r *Request) Timeout(d time.Duration) *Request {
	if r.err != nil {
		return r
	}
	r.timeout = d
	return r
}
964679
func Timeout(t time.Duration) metaOp {
	return func(c *Client) {
		c.http.Timeout = t
	}
}
1123266
func (s *IngestDeletePipelineService) Timeout(timeout string) *IngestDeletePipelineService {
	s.timeout = timeout
	return s
}
1299585
func (c *Client) pingRoutine() {
	ticker := time.NewTicker(time.Second * 5)
	defer ticker.Stop()

	var timestamp uint64
	var tcpPingAvg float32
	var tcpPingVar float32
	packet := MumbleProto.Ping{
		Timestamp:  &timestamp,
		TcpPackets: &c.tcpPacketsReceived,
		TcpPingAvg: &tcpPingAvg,
		TcpPingVar: &tcpPingVar,
	}

	t := time.Now()
	for {
		timestamp = uint64(t.UnixNano())
		tcpPingAvg = math.Float32frombits(atomic.LoadUint32(&c.tcpPingAvg))
		tcpPingVar = math.Float32frombits(atomic.LoadUint32(&c.tcpPingVar))
		c.Conn.WriteProto(&packet)

		select {
		case <-c.end:
			return
		case t = <-ticker.C:
			// continue to top of loop
		}
	}
}
111863
func Timeout(t time.Duration) Option {
	return func(o *Options) {
		o.Timeout = t
	}
}
999366
func (s *IndicesPutTemplateService) Timeout(timeout string) *IndicesPutTemplateService {
	s.timeout = timeout
	return s
}
523603
func (gr *GoReq) Timeout(timeout time.Duration) *GoReq {
	gr.Transport.Dial = func(network, addr string) (net.Conn, error) {
		conn, err := net.DialTimeout(network, addr, timeout)
		if err != nil {
			gr.Errors = append(gr.Errors, err)
			return nil, err
		}
		conn.SetDeadline(time.Now().Add(timeout))
		return conn, nil
	}
	return gr
}
288295
func (c PubSubConn) ReceiveWithTimeout(timeout time.Duration) interface{} {
	return c.receiveInternal(ReceiveWithTimeout(c.Conn, timeout))
}
494757
func Timeout(d time.Duration) Option {
	return QueryParam(
		"timeoutSeconds",
		strconv.FormatInt(int64(d/time.Second), 10),
	)
}
1188177
func (p *Plugin) Timeout() time.Duration {
	p.mu.RLock()
	t := p.timeout
	p.mu.RUnlock()
	return t
}
151686
func (ri *ReindexRemoteInfo) SocketTimeout(timeout string) *ReindexRemoteInfo {
	ri.socketTimeout = timeout
	return ri
}