MCPcopy Index your code
hub / github.com/koding/kite / TellKontrolWithTimeout

Method TellKontrolWithTimeout

kontrolclient.go:512–531  ·  view source on GitHub ↗

TellKontrolWithTimeout is a lower level function for communicating directly with kontrol. Like GetKites and GetToken, this automatically sets up and connects to kontrol as needed.

(method string, timeout time.Duration, args ...interface{})

Source from the content-addressed store, hash-verified

510// kontrol. Like GetKites and GetToken, this automatically sets up and connects to
511// kontrol as needed.
512func (k *Kite) TellKontrolWithTimeout(method string, timeout time.Duration, args ...interface{}) (result *dnode.Partial, err error) {
513 if err := k.SetupKontrolClient(); err != nil {
514 return nil, err
515 }
516
517 // Wait for readyConnect, or timeout
518 select {
519 case <-time.After(k.Config.Timeout):
520 return nil, &Error{
521 Type: "timeout",
522 Message: fmt.Sprintf(
523 "Timed out registering to kontrol for %s method after %s",
524 method, k.Config.Timeout,
525 ),
526 }
527 case <-k.kontrol.readyConnected:
528 }
529
530 return k.kontrol.TellWithTimeout(method, timeout, args...)
531}

Callers 1

TestRegisterDenyEvilFunction · 0.80

Calls 2

SetupKontrolClientMethod · 0.95
TellWithTimeoutMethod · 0.80

Tested by 1

TestRegisterDenyEvilFunction · 0.64