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:
13
pubsub.go
13
pubsub.go
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user