TerminateSubscriptions will terminate all the subscriptions of the given bucketID.
(bucketID uint64)
| 234 | |
| 235 | // TerminateSubscriptions will terminate all the subscriptions of the given bucketID. |
| 236 | func (p *Poller) terminateSubscriptions(bucketID uint64) { |
| 237 | p.Lock() |
| 238 | defer p.Unlock() |
| 239 | subscriptions, ok := p.pollRegistry[bucketID] |
| 240 | if !ok { |
| 241 | return |
| 242 | } |
| 243 | for _, subscriber := range subscriptions { |
| 244 | // Closing the channel will close the graphQL websocket connection as well. |
| 245 | close(subscriber.updateCh) |
| 246 | } |
| 247 | delete(p.pollRegistry, bucketID) |
| 248 | } |
| 249 | |
| 250 | func (p *Poller) TerminateSubscription(bucketID, subscriptionID uint64) { |
| 251 | p.Lock() |