SSubscribe Subscribes the client to the specified shard channels.
(ctx context.Context, channels ...string)
| 703 | |
| 704 | // SSubscribe Subscribes the client to the specified shard channels. |
| 705 | func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub { |
| 706 | if len(channels) == 0 { |
| 707 | panic("at least one channel is required") |
| 708 | } |
| 709 | shard, err := c.sharding.GetByKey(channels[0]) |
| 710 | if err != nil { |
| 711 | // TODO: return PubSub with sticky error |
| 712 | panic(err) |
| 713 | } |
| 714 | return shard.Client.SSubscribe(ctx, channels...) |
| 715 | } |
| 716 | |
| 717 | func (c *Ring) OnNewNode(fn func(rdb *Client)) { |
| 718 | c.sharding.OnNewNode(fn) |
nothing calls this directly
no test coverage detected