Example #1
0
func asyncFlushAndQuitOnCompletion(t *testing.T, client redis.AsyncClient) {
	// flush it
	fStat, e := client.Flushdb()
	if e != nil {
		t.Errorf("on Flushdb - %s", e)
	}
	ok, fe := fStat.Get()
	if fe != nil {
		t.Fatalf("BUG - non-Error future result get must never return error - got: %s", fe)
	}
	if !ok {
		t.Fatalf("BUG - non-Error flushdb future result must always be true ")
	}

	fStat, e = client.Quit()
	if e != nil {
		t.Errorf("on Quit - %s", e)
	}
	ok, fe = fStat.Get()
	if fe != nil {
		t.Fatalf("BUG - non-Error future result get must never return error - got: %s", fe)
	}
	if !ok {
		t.Fatalf("BUG - non-Error quit future result must always be true ")
	}
}
Example #2
0
func setup(client redis.AsyncClient) {
	fr, e := client.Flushdb()
	if e != nil {
		log.Println("Error creating client for worker: ", e)
		log.Println("fr: ", fr)
		panic(e)
	}
	frr, e2 := fr.Get()
	if e2 != nil {
		log.Println("Error creating client for worker: ", e2)
		log.Println("frr: ", frr)
		panic(e)
	}
}
Example #3
0
func FlushAsyncClient(t *testing.T, client redis.AsyncClient) {
	// flush it
	fstat, e := client.Flushdb()
	if e != nil {
		t.Fatalf("on Flushdb - %s", e)
	}
	ok, fe := fstat.Get()
	if fe != nil {
		t.Fatalf("on fstat.Get() - %s", fe)
	}
	if !ok {
		t.Fatalf("fstat.Get() returned false")
	}
}