(topicName string, message string)
| 46 | } |
| 47 | |
| 48 | func Pub(topicName string, message string) error { |
| 49 | if _, ok := pss.join[topicName]; !ok { |
| 50 | _, err := JoinPubSub(pss.p2p, "redis-client", topicName) |
| 51 | if err != nil { |
| 52 | log.Println(err) |
| 53 | return err |
| 54 | } |
| 55 | } |
| 56 | ps := pss.join[topicName] |
| 57 | ps.Outbound <- message |
| 58 | return nil |
| 59 | } |
| 60 | |
| 61 | func Sub(local *RESPHandle.WriterHandle, topicName string) (*PubSub, error) { |
| 62 | if _, ok := pss.join[topicName]; !ok { |