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

Method SSubscribe

pubsub.go:263–275  ·  view source on GitHub ↗

SSubscribe Subscribes the client to the specified shard channels.

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

Source from the content-addressed store, hash-verified

261
262// SSubscribe Subscribes the client to the specified shard channels.
263func (c *PubSub) SSubscribe(ctx context.Context, channels ...string) error {
264 c.mu.Lock()
265 defer c.mu.Unlock()
266
267 err := c.subscribe(ctx, "ssubscribe", channels...)
268 if c.schannels == nil {
269 c.schannels = make(map[string]struct{})
270 }
271 for _, s := range channels {
272 c.schannels[s] = struct{}{}
273 }
274 return err
275}
276
277// Unsubscribe the client from the given channels, or from all of
278// them if none is given.

Callers

nothing calls this directly

Calls 1

subscribeMethod · 0.95

Tested by

no test coverage detected