sqlite的api,便于内部使用
liuxiaolong
2019-05-16 dcd9ad9903a13a589973341d53272f1d1ed3c514
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)
    }
}