MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Pub

Function Pub

IceFireDB-PubSub/pkg/ppubsub/pubsubStore.go:48–59  ·  view source on GitHub ↗
(topicName string, message string)

Source from the content-addressed store, hash-verified

46}
47
48func 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
61func Sub(local *RESPHandle.WriterHandle, topicName string) (*PubSub, error) {
62 if _, ok := pss.join[topicName]; !ok {

Callers 1

cmdPpubMethod · 0.92

Calls 1

JoinPubSubFunction · 0.70

Tested by

no test coverage detected