MCPcopy Create free account
hub / github.com/foxcpp/maddy / Subscribe

Method Subscribe

internal/updatepipe/pubsub_pipe.go:57–69  ·  view source on GitHub ↗
(key interface{})

Source from the content-addressed store, hash-verified

55}
56
57func (p *PubSubPipe) Subscribe(key interface{}) {
58 psKey, err := p.channel(key)
59 if err != nil {
60 p.Log.Error("invalid key passed to Subscribe", err)
61 return
62 }
63
64 if err := p.PubSub.Subscribe(context.TODO(), psKey); err != nil {
65 p.Log.Error("pubsub subscribe failed", err)
66 } else {
67 p.Log.DebugMsg("subscribed to pubsub", "channel", psKey)
68 }
69}
70
71func (p *PubSubPipe) Unsubscribe(key interface{}) {
72 psKey, err := p.channel(key)

Callers

nothing calls this directly

Calls 4

channelMethod · 0.95
DebugMsgMethod · 0.80
SubscribeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected