pub/sub: Clean up message parsing.

This commit is contained in:
Vladimir Mihailenco 2012-08-25 21:39:35 +03:00
parent 8c7af722cc
commit 4e3743c0d6
1 changed files with 31 additions and 37 deletions

View File

@ -37,7 +37,6 @@ type Message struct {
func (c *PubSubClient) consumeMessages(conn *Conn) { func (c *PubSubClient) consumeMessages(conn *Conn) {
req := NewIfaceSliceReq() req := NewIfaceSliceReq()
for {
for { for {
msg := &Message{} msg := &Message{}
@ -73,11 +72,6 @@ func (c *PubSubClient) consumeMessages(conn *Conn) {
msg.Err = fmt.Errorf("Unsupported message name: %q.", msgName) msg.Err = fmt.Errorf("Unsupported message name: %q.", msgName)
} }
c.ch <- msg c.ch <- msg
if conn.Rd.Buffered() <= 0 {
break
}
}
} }
} }