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

Method Run

server.go:18–38  ·  view source on GitHub ↗

Run is a blocking method. It runs the kite server and then accepts requests asynchronously. It supports graceful restart via SIGUSR2.

()

Source from the content-addressed store, hash-verified

16// Run is a blocking method. It runs the kite server and then accepts requests
17// asynchronously. It supports graceful restart via SIGUSR2.
18func (k *Kite) Run() {
19 if os.Getenv("KITE_VERSION") != "" {
20 fmt.Println(k.Kite().Version)
21 os.Exit(0)
22 }
23
24 // An error string equivalent to net.errClosing for using with http.Serve()
25 // during a graceful exit. Needed to declare here again because it is not
26 // exported by "net" package.
27 const errClosing = "use of closed network connection"
28
29 err := k.listenAndServe()
30 if err != nil {
31 if strings.Contains(err.Error(), errClosing) {
32 // The server is closed by Close() method
33 k.Log.Info("Kite server is closed.")
34 return
35 }
36 k.Log.Fatal(err.Error())
37 }
38}
39
40// Close stops the server and the kontrol client instance.
41func (k *Kite) Close() {

Callers 15

TestMethod_ThrottlingFunction · 0.45
TestMethod_LatestFunction · 0.45
TestMethod_FirstFunction · 0.45
TestMethod_ErrorFunction · 0.45
TestMethod_BaseFunction · 0.45
TestContextFunction · 0.45
TestMultipleFunction · 0.45
TestSendErrorFunction · 0.45
TestConcurrencyFunction · 0.45
TestKiteFunction · 0.45
TestParseWebRTCMessageFunction · 0.45

Calls 5

KiteMethod · 0.95
listenAndServeMethod · 0.95
InfoMethod · 0.80
FatalMethod · 0.80
ErrorMethod · 0.65

Tested by 14

TestMethod_ThrottlingFunction · 0.36
TestMethod_LatestFunction · 0.36
TestMethod_FirstFunction · 0.36
TestMethod_ErrorFunction · 0.36
TestMethod_BaseFunction · 0.36
TestContextFunction · 0.36
TestMultipleFunction · 0.36
TestSendErrorFunction · 0.36
TestConcurrencyFunction · 0.36
TestKiteFunction · 0.36
TestParseWebRTCMessageFunction · 0.36