MCPcopy
hub / github.com/redis/go-redis / processPendingPushNotificationWithReader

Method processPendingPushNotificationWithReader

redis.go:1763–1773  ·  view source on GitHub ↗

processPendingPushNotificationWithReader processes all pending push notifications on a connection This method should be called by the client in WithReader before reading the reply

(ctx context.Context, cn *pool.Conn, rd *proto.Reader)

Source from the content-addressed store, hash-verified

1761// processPendingPushNotificationWithReader processes all pending push notifications on a connection
1762// This method should be called by the client in WithReader before reading the reply
1763func (c *baseClient) processPendingPushNotificationWithReader(ctx context.Context, cn *pool.Conn, rd *proto.Reader) error {
1764 // if we have the reader, we don't need to check for data on the socket, we are waiting
1765 // for either a reply or a push notification, so we can block until we get a reply or reach the timeout
1766 if c.opt.Protocol != 3 || c.pushProcessor == nil {
1767 return nil
1768 }
1769
1770 // Create handler context with client, connection pool, and connection information
1771 handlerCtx := c.pushNotificationHandlerContext(cn)
1772 return c.pushProcessor.ProcessPendingNotifications(ctx, handlerCtx, rd)
1773}
1774
1775// pushNotificationHandlerContext creates a handler context for push notification processing
1776func (c *baseClient) pushNotificationHandlerContext(cn *pool.Conn) push.NotificationHandlerContext {

Callers 3

_processMethod · 0.95
pipelineReadCmdsMethod · 0.95
txPipelineReadQueuedMethod · 0.95

Tested by

no test coverage detected