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

Method PSubscribe

osscluster.go:2263–2269  ·  view source on GitHub ↗

PSubscribe subscribes the client to the given patterns. Patterns can be omitted to create empty subscription.

(ctx context.Context, channels ...string)

Source from the content-addressed store, hash-verified

2261// PSubscribe subscribes the client to the given patterns.
2262// Patterns can be omitted to create empty subscription.
2263func (c *ClusterClient) PSubscribe(ctx context.Context, channels ...string) *PubSub {
2264 pubsub := c.pubSub()
2265 if len(channels) > 0 {
2266 _ = pubsub.PSubscribe(ctx, channels...)
2267 }
2268 return pubsub
2269}
2270
2271// SSubscribe Subscribes the client to the specified shard channels.
2272func (c *ClusterClient) SSubscribe(ctx context.Context, channels ...string) *PubSub {

Callers

nothing calls this directly

Calls 2

pubSubMethod · 0.95
PSubscribeMethod · 0.65

Tested by

no test coverage detected