MCPcopy Index your code
hub / github.com/Monibuca/engine / SubscribeExist

Method SubscribeExist

plugin.go:220–228  ·  view source on GitHub ↗

SubscribeExist 订阅已经存在的流

(streamPath string, sub ISubscriber)

Source from the content-addressed store, hash-verified

218
219// SubscribeExist 订阅已经存在的流
220func (opt *Plugin) SubscribeExist(streamPath string, sub ISubscriber) error {
221 opt.Info("subscribe exsit", zap.String("path", streamPath))
222 path, _, _ := strings.Cut(streamPath, "?")
223 if !Streams.Has(path) {
224 opt.Warn("stream not exist", zap.String("path", streamPath))
225 return ErrStreamNotExist
226 }
227 return opt.Subscribe(streamPath, sub)
228}
229func (opt *Plugin) AssignSubConfig(suber *Subscriber) {
230 if suber.Config == nil {
231 conf, ok := opt.Config.(config.SubscribeConfig)

Callers

nothing calls this directly

Calls 5

SubscribeMethod · 0.95
InfoMethod · 0.65
WarnMethod · 0.65
StringMethod · 0.45
HasMethod · 0.45

Tested by

no test coverage detected