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

Method ChannelWithSubscriptions

pubsub.go:597–607  ·  view source on GitHub ↗

ChannelWithSubscriptions is like Channel, but message type can be either *Subscription or *Message. Subscription messages can be used to detect reconnections. ChannelWithSubscriptions can not be used together with Channel or ChannelSize.

(opts ...ChannelOption)

Source from the content-addressed store, hash-verified

595//
596// ChannelWithSubscriptions can not be used together with Channel or ChannelSize.
597func (c *PubSub) ChannelWithSubscriptions(opts ...ChannelOption) <-chan interface{} {
598 c.chOnce.Do(func() {
599 c.allCh = newChannel(c, opts...)
600 c.allCh.initAllChan()
601 })
602 if c.allCh == nil {
603 err := fmt.Errorf("redis: ChannelWithSubscriptions can't be called after Channel")
604 panic(err)
605 }
606 return c.allCh.allCh
607}
608
609func (c *PubSub) processPendingPushNotificationWithReader(ctx context.Context, cn *pool.Conn, rd *proto.Reader) error {
610 // Only process push notifications for RESP3 connections with a processor

Callers

nothing calls this directly

Calls 3

newChannelFunction · 0.85
initAllChanMethod · 0.80
DoMethod · 0.65

Tested by

no test coverage detected