Browse Source

Actually make channels for the broker to communicate over

Evan Huus 12 years ago
parent
commit
cf32a3571e
1 changed files with 5 additions and 2 deletions
  1. 5 2
      broker.go

+ 5 - 2
broker.go

@@ -53,8 +53,11 @@ func (b *broker) connect() (err error) {
 		return err
 	}
 
+	b.requests = make(chan responsePromise)
+	b.responses = make(chan responsePromise)
+
 	go b.sendRequestLoop()
-	go b.rcvresponsePromiseLoop()
+	go b.rcvResponseLoop()
 
 	return nil
 }
@@ -112,7 +115,7 @@ func (b *broker) sendRequestLoop() {
 	}
 }
 
-func (b *broker) rcvresponsePromiseLoop() {
+func (b *broker) rcvResponseLoop() {
 	header := make([]byte, 8)
 	for response := range b.responses {
 		_, err := io.ReadFull(b.conn, header)