Esempio n. 1
0
func (t *ATestSuite) TestNewAsync(c *C) {
	var g *godspeed.AsyncGodspeed
	g, err := godspeed.NewAsync("127.0.0.1", 8125, false)
	c.Assert(err, IsNil)

	defer g.Godspeed.Conn.Close()

	testAsyncBasicFunc(t, c, g)
}
Esempio n. 2
0
func ExampleNewAsync() {
	a, err := godspeed.NewAsync(godspeed.DefaultHost, godspeed.DefaultPort, false)

	if err != nil {
		// handle error
	}

	defer a.Godspeed.Conn.Close()

	// add to the WaitGroup to make sure we are able to wait below
	a.W.Add(1)

	go a.Gauge("example.gauge", 1, nil, a.W)

	a.W.Wait()
}