(ctx context.Context, p2p *p2p.P2P)
| 36 | } |
| 37 | |
| 38 | func NewPubsubStore(ctx context.Context, p2p *p2p.P2P) *pubsubStore { |
| 39 | s := &pubsubStore{ |
| 40 | ctx: ctx, |
| 41 | p2p: p2p, |
| 42 | join: make(map[string]*PubSub), |
| 43 | writer: make(map[string]map[string]*RESPHandle.WriterHandle), |
| 44 | } |
| 45 | return s |
| 46 | } |
| 47 | |
| 48 | func Pub(topicName string, message string) error { |
| 49 | if _, ok := pss.join[topicName]; !ok { |