//Starts the timeout worker
197373
func (_ *timeoutInfo) start(TimeoutChannel chan *timeoutInfo, timeout int64) {
	for j := range TimeoutChannel {
		j.started = time.Now()
		j.state = StartJob
		j.worker.workInfo.Status(j.state, j.worker)
		for {
			select {
			case complete, ok := <-TimeoutChannel:
				if !ok {
					// Channel closed returning...
					return
				}
				// Received new State, record and loop
				complete.worker.workInfo.Status(complete.state, complete.worker)
				break
			case <-time.After(time.Second * time.Duration(timeout)):
				j.worker.workInfo.Status(JobLongrunning, j.worker)
			}
		}
	}
}
460533
func (s *PutMappingService) Timeout(timeout string) *PutMappingService {
	s.timeout = timeout
	return s
}
985159
func (s *JobUpdate) SetTimeout(v int64) *JobUpdate {
	s.Timeout = &v
	return s
}
1001075
func (w *Worker) Start() {
	handlerInterrupted := false
	go func() {
		for taskAndStrategy := range w.HandlerInputChannel {
			result := taskAndStrategy.Strategy(w, taskAndStrategy.WorkerTask.Msg, taskAndStrategy.WorkerTask.Id())
		Loop:
			for !handlerInterrupted {
				timeout := time.NewTimer(5 * time.Second)
				select {
				case w.HandlerOutputChannel <- result:
					timeout.Stop()
					break Loop
				case <-timeout.C:
				}
			}
			handlerInterrupted = false
		}
	}()

	go func() {
		for taskAndStrategy := range w.InputChannel {
			taskAndStrategy.WorkerTask.Callee = w
			w.HandlerInputChannel <- taskAndStrategy
			timeout := time.NewTimer(w.TaskTimeout)
			select {
			case result := <-w.HandlerOutputChannel:
				{
					w.OutputChannel <- result
				}
			case <-timeout.C:
				{
					handlerInterrupted = true
					w.OutputChannel <- &TimedOutResult{taskAndStrategy.WorkerTask.Id()}
				}
			}
			timeout.Stop()
		}
	}()
}
1346319
func (s *Job) SetTimeout(v int64) *Job {
	s.Timeout = &v
	return s
}
198931
func (s *ReindexService) Timeout(timeout string) *ReindexService {
	s.timeout = timeout
	return s
}
1294698
func (s *IndexService) Timeout(timeout string) *IndexService {
	s.timeout = timeout
	return s
}
784779
func (s *SearchSource) Timeout(timeout string) *SearchSource {
	s.timeout = timeout
	return s
}
1275818
func (s *IndicesUnfreezeService) Timeout(timeout string) *IndicesUnfreezeService {
	s.timeout = timeout
	return s
}
638879
func (s *JobDefinition) SetTimeout(v *JobTimeout) *JobDefinition {
	s.Timeout = v
	return s
}
964679
func Timeout(t time.Duration) metaOp {
	return func(c *Client) {
		c.http.Timeout = t
	}
}
1090256
func (e *OpError) Timeout() bool {
	if ne, ok := e.Err.(*os.SyscallError); ok {
		t, ok := ne.Err.(timeout)
		return ok && t.Timeout()
	}
	t, ok := e.Err.(timeout)
	return ok && t.Timeout()
}
778559
func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
	return d.config.PropagationTimeout, d.config.PollingInterval
}
917765
func (s *IndicesPutMappingService) Timeout(timeout string) *IndicesPutMappingService {
	s.timeout = timeout
	return s
}
1320642
func (c *Client) SetTimeout(t int) *Client {
	c.Timeout = t
	return c
}
966299
func (c *Client) SetTimeout(t time.Duration) {
	if c.HTTPClient != nil {
		c.HTTPClient.Timeout = t
	}
}
681065
func (s *SnapshotVerifyRepositoryService) Timeout(timeout string) *SnapshotVerifyRepositoryService {
	s.timeout = timeout
	return s
}