1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Get rid of custom buffered reader.

This commit is contained in:
Vladimir Mihailenco
2012-08-09 13:12:41 +03:00
parent ea3677294b
commit b2e3463af1
8 changed files with 103 additions and 100 deletions

View File

@ -42,17 +42,6 @@ func (c *PubSubClient) consumeMessages() {
req := NewMultiBulkReq()
for {
// Replies can arrive in batches.
// Read whole reply and parse messages one by one.
err := c.ReadReply(conn)
if err != nil {
msg := &Message{}
msg.Err = err
c.ch <- msg
return
}
for {
msg := &Message{}
@ -79,7 +68,7 @@ func (c *PubSubClient) consumeMessages() {
}
c.ch <- msg
if !conn.Rd.HasUnread() {
if conn.Rd.Buffered() <= 0 {
break
}
}