Commit 6c0c3920 authored by Upliner's avatar Upliner

Add parallel write

parent ae88778b
......@@ -87,6 +87,24 @@ func main() {
existingVids := queryItems(conn)
fmt.Println("Items queried")
cnt := 100000
fmt.Println("Running writer")
go func() {
conn := GetTTConnn(os.Args[1])
fchan := make(chan *tarantool.Future, 100000)
go func() {
for {
fchan <- conn.InsertAsync("visitorid_matching", []interface{}{"host1", "host2", newVid(), newVid()})
time.Sleep(time.Microsecond* 100)
}
close(fchan)
}()
for f := range fchan {
_, err := f.Get()
if err != nil {
log.Fatal(err)
}
}
}()
fmt.Println("Item count",cnt)
items := genItems(existingVids, cnt)
for _, item := range items {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment