MCPcopy
hub / github.com/tinode/chat / ChannelSub

Function ChannelSub

server/push/push.go:180–196  ·  view source on GitHub ↗

ChannelSub handles a channel (FCM topic) subscription/unsubscription request.

(msg *ChannelReq)

Source from the content-addressed store, hash-verified

178
179// ChannelSub handles a channel (FCM topic) subscription/unsubscription request.
180func ChannelSub(msg *ChannelReq) {
181 if handlers == nil {
182 return
183 }
184
185 for _, hnd := range handlers {
186 if !hnd.IsReady() {
187 continue
188 }
189
190 // Send without delay or skip.
191 select {
192 case hnd.Channel() <- msg:
193 default:
194 }
195 }
196}
197
198// Stop all pushes
199func Stop() {

Callers 2

channelSubUnsubMethod · 0.92
userChannelsSubUnsubFunction · 0.92

Calls 2

IsReadyMethod · 0.65
ChannelMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…