1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| package dbapi
|
| import (
| "fmt"
| "testing"
| "time"
| )
|
| func TestMangosReqClient(t *testing.T){
| var reqClient1 ReqrepApi
| var reqClient2 ReqrepApi
|
| go doRequest(reqClient1, "one")
| go doRequest(reqClient2, "two")
| time.Sleep(time.Duration(5)*time.Second)
| }
|
| func doRequest(client ReqrepApi, idx string){
| for {
| msg := client.SendRequest(idx)
| fmt.Printf("receive msg: %s", msg)
| }
| }
|
|