kite icon indicating copy to clipboard operation
kite copied to clipboard

Is it necessary to close the client in the sample code?

Open aapelismith opened this issue 7 years ago • 0 comments

Is it necessary to close the client in the sample code?

package main

import (
	"fmt"

	"github.com/koding/kite"
)

func main() {
	k := kite.New("exp2", "1.0.0")

	// Connect to our math kite
	mathWorker := k.NewClient("http://localhost:3636/kite")
	mathWorker.Dial()
       **defer  mathWorker.Close()**

	response, _ := mathWorker.Tell("square", 4) // call "square" method with argument 4
	fmt.Println("result:", response.MustFloat64())
}

aapelismith avatar Dec 21 '18 07:12 aapelismith