"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bench/bench_reader/bench_reader.go" between
nsq-1.2.0.tar.gz and nsq-1.2.1.tar.gz

About: nsq is a realtime distributed and and decentralized messaging platform.

bench_reader.go  (nsq-1.2.0):bench_reader.go  (nsq-1.2.1)
package main package main
import ( import (
"bufio" "bufio"
"flag" "flag"
"fmt"
"log" "log"
"net" "net"
"runtime" "runtime"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/nsqio/go-nsq" "github.com/nsqio/go-nsq"
) )
skipping to change at line 78 skipping to change at line 79
} }
func subWorker(td time.Duration, workers int, tcpAddr string, topic string, chan nel string, rdyChan chan int, goChan chan int, id int) { func subWorker(td time.Duration, workers int, tcpAddr string, topic string, chan nel string, rdyChan chan int, goChan chan int, id int) {
conn, err := net.DialTimeout("tcp", tcpAddr, time.Second) conn, err := net.DialTimeout("tcp", tcpAddr, time.Second)
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }
conn.Write(nsq.MagicV2) conn.Write(nsq.MagicV2)
rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn))
ci := make(map[string]interface{}) ci := make(map[string]interface{})
ci["client_id"] = "test" ci["client_id"] = "reader"
ci["hostname"] = "reader"
ci["user_agent"] = fmt.Sprintf("bench_reader/%s", nsq.VERSION)
cmd, _ := nsq.Identify(ci) cmd, _ := nsq.Identify(ci)
cmd.WriteTo(rw) cmd.WriteTo(rw)
nsq.Subscribe(topic, channel).WriteTo(rw) nsq.Subscribe(topic, channel).WriteTo(rw)
rdyChan <- 1 rdyChan <- 1
<-goChan <-goChan
nsq.Ready(*rdy).WriteTo(rw) nsq.Ready(*rdy).WriteTo(rw)
rw.Flush() rw.Flush()
nsq.ReadResponse(rw) nsq.ReadResponse(rw)
nsq.ReadResponse(rw) nsq.ReadResponse(rw)
var msgCount int64 var msgCount int64
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)