PSubscribe subscribes the client to the given patterns.
(ctx context.Context, channels ...string)
| 689 | |
| 690 | // PSubscribe subscribes the client to the given patterns. |
| 691 | func (c *Ring) PSubscribe(ctx context.Context, channels ...string) *PubSub { |
| 692 | if len(channels) == 0 { |
| 693 | panic("at least one channel is required") |
| 694 | } |
| 695 | |
| 696 | shard, err := c.sharding.GetByKey(channels[0]) |
| 697 | if err != nil { |
| 698 | // TODO: return PubSub with sticky error |
| 699 | panic(err) |
| 700 | } |
| 701 | return shard.Client.PSubscribe(ctx, channels...) |
| 702 | } |
| 703 | |
| 704 | // SSubscribe Subscribes the client to the specified shard channels. |
| 705 | func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub { |
nothing calls this directly
no test coverage detected