// CallTimeout calls the given function and waits for response during the given timeout.
//
// All the non-internal request and response types must be registered
// via RegisterType() before the first call to this function.
161636
func (dc *DispatcherClient) CallTimeout(funcName string, request interface{}, timeout time.Duration) (response interface{}, err error) {
	req := dc.getRequest(funcName, request)
	resp, err := dc.c.CallTimeout(req, timeout)
	return getResponse(resp, err)
}
695523
func (s *Service) stopTimeout(timeout int) int {
	DEFAULTTIMEOUT := 10
	if timeout != 0 {
		return timeout
	}
	configTimeout := utils.DurationStrToSecondsInt(s.Config().StopGracePeriod)
	if configTimeout != nil {
		return *configTimeout
	}
	return DEFAULTTIMEOUT
}
392787
func (c *Client) SetTimeout(timeout time.Duration) *Client {
	c.httpClient.Timeout = timeout
	return c
}
545636
func (container *container) WaitTimeout(timeout time.Duration) error {
	container.waitOnce.Do(func() {
		container.waitCh = make(chan struct{})
		go func() {
			container.waitErr = container.Wait()
			close(container.waitCh)
		}()
	})
	t := time.NewTimer(timeout)
	defer t.Stop()
	select {
	case <-t.C:
		return &ContainerError{Container: container, Err: ErrTimeout, Operation: "hcsshim::ComputeSystem::Wait"}
	case <-container.waitCh:
		return container.waitErr
	}
}
600399
func (b *UpdateService) Timeout(timeout string) *UpdateService {
	b.timeout = timeout
	return b
}
647360
func (f *MockFunction) Timeout(d time.Duration) *MockFunction {
	f.timeout = d
	return f
}
111863
func Timeout(t time.Duration) Option {
	return func(o *Options) {
		o.Timeout = t
	}
}
874547
func (s *ClusterHealthService) Timeout(timeout string) *ClusterHealthService {
	s.timeout = timeout
	return s
}
1106485
func WithRequestTimeout(t time.Duration) func(*RequestOpts) {
	return func(o *RequestOpts) {
		o.Timeout = t
	}
}
646915
func FunctionTimeout(fn func() error, timeout time.Duration) error {
	c := make(chan error, 1)
	go func() {
		c <- fn()
	}()
	select {
	case err := <-c:
		return err
	case <-time.After(timeout):
		return errors.New("timeout")
	}
}
484345
func (c *EndpointConfig) Timeout(tType fab.TimeoutType) time.Duration {
	return c.getTimeout(tType)
}
504588
func (s *UpdateByQueryService) Timeout(timeout string) *UpdateByQueryService {
	s.timeout = timeout
	return s
}
1204070
func (s *Action) SetTimeout(v int64) *Action {
	s.Timeout = &v
	return s
}
10977
func StartTimeout(timeout time.Duration) Option {
	return func(o *Options) {
		o.StartTimeout = timeout
	}
}
1275818
func (s *IndicesUnfreezeService) Timeout(timeout string) *IndicesUnfreezeService {
	s.timeout = timeout
	return s
}
767247
func DialTimeout(d time.Duration) Option {
	return func(o *Options) {
		o.CallOptions.DialTimeout = d
	}
}
697430
func (s *CreateJobInput) SetTimeout(v int64) *CreateJobInput {
	s.Timeout = &v
	return s
}