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

Function newChannel

pubsub.go:695–712  ·  view source on GitHub ↗
(pubSub *PubSub, opts ...ChannelOption)

Source from the content-addressed store, hash-verified

693}
694
695func newChannel(pubSub *PubSub, opts ...ChannelOption) *channel {
696 c := &channel{
697 pubSub: pubSub,
698
699 chanSize: 100,
700 chanSendTimeout: time.Minute,
701 checkInterval: 3 * time.Second,
702 pingTimeout: 5 * time.Second,
703 reconnectTimeout: 10 * time.Second,
704 }
705 for _, opt := range opts {
706 opt(c)
707 }
708 if c.checkInterval > 0 {
709 c.initHealthCheck()
710 }
711 return c
712}
713
714func (c *channel) initHealthCheck() {
715 c.ping = make(chan struct{}, 1)

Callers 2

ChannelMethod · 0.85

Calls 1

initHealthCheckMethod · 0.95

Tested by

no test coverage detected