MCPcopy
hub / github.com/mudler/LocalAI / CloseBroadcasts

Method CloseBroadcasts

core/services/galleryop/service.go:623–633  ·  view source on GitHub ↗

CloseBroadcasts drops the wildcard subscriptions. Safe to call multiple times.

()

Source from the content-addressed store, hash-verified

621
622// CloseBroadcasts drops the wildcard subscriptions. Safe to call multiple times.
623func (g *GalleryService) CloseBroadcasts() {
624 g.Lock()
625 subs := g.broadcastSubs
626 g.broadcastSubs = nil
627 g.Unlock()
628 for _, s := range subs {
629 if err := s.Unsubscribe(); err != nil {
630 xlog.Warn("GalleryService unsubscribe failed", "error", err)
631 }
632 }
633}
634
635// Hydrate loads still-active operations from the GalleryStore into the
636// in-memory statuses map so a freshly-started replica does not return an

Callers 1

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
UnsubscribeMethod · 0.65

Tested by

no test coverage detected