@@ -2,7 +2,6 @@ package push
2
2
3
3
import (
4
4
"context"
5
- "time"
6
5
7
6
"github.com/redis/go-redis/v9/internal"
8
7
"github.com/redis/go-redis/v9/internal/proto"
@@ -52,23 +51,8 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, handlerCtx
52
51
if rd == nil {
53
52
return nil
54
53
}
55
- conn := handlerCtx .Conn
56
- if conn == nil {
57
- return nil
58
- }
59
- netConn := handlerCtx .Conn .GetNetConn ()
60
- if netConn == nil {
61
- return nil
62
- }
63
54
64
55
for {
65
- // Set a short read deadline to check for available data
66
- // otherwise we may block on Peek if there is no data available
67
- err := netConn .SetReadDeadline (time .Now ().Add (1 ))
68
- if err != nil {
69
- return err
70
- }
71
-
72
56
// Check if there's data available to read
73
57
replyType , err := rd .PeekReplyType ()
74
58
if err != nil {
@@ -120,7 +104,7 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, handlerCtx
120
104
}
121
105
}
122
106
123
- return netConn . SetReadDeadline (time. Time {})
107
+ return nil
124
108
}
125
109
126
110
// VoidProcessor discards all push notifications without processing them
@@ -154,20 +138,8 @@ func (v *VoidProcessor) ProcessPendingNotifications(_ context.Context, handlerCt
154
138
if rd == nil {
155
139
return nil
156
140
}
157
- conn := handlerCtx .Conn
158
- if conn == nil {
159
- return nil
160
- }
161
- netConn := handlerCtx .Conn .GetNetConn ()
162
- if netConn == nil {
163
- return nil
164
- }
141
+
165
142
for {
166
- // Set a short read deadline to check for available data
167
- err := netConn .SetReadDeadline (time .Now ().Add (1 ))
168
- if err != nil {
169
- return err
170
- }
171
143
// Check if there's data available to read
172
144
replyType , err := rd .PeekReplyType ()
173
145
if err != nil {
@@ -196,15 +168,15 @@ func (v *VoidProcessor) ProcessPendingNotifications(_ context.Context, handlerCt
196
168
return nil
197
169
}
198
170
}
199
- return netConn . SetReadDeadline (time. Time {})
171
+ return nil
200
172
}
201
173
202
174
// willHandleNotificationInClient checks if a notification type should be ignored by the push notification
203
175
// processor and handled by other specialized systems instead (pub/sub, streams, keyspace, etc.).
204
176
func willHandleNotificationInClient (notificationType string ) bool {
205
177
switch notificationType {
206
178
// Pub/Sub notifications - handled by pub/sub system
207
- case "message" , // Regular pub/sub message
179
+ case "message" , // Regular pub/sub message
208
180
"pmessage" , // Pattern pub/sub message
209
181
"subscribe" , // Subscription confirmation
210
182
"unsubscribe" , // Unsubscription confirmation
0 commit comments