MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / runDistributor

Method runDistributor

watch_manager.go:316–340  ·  view source on GitHub ↗

runDistributor distributes batches to subscribers

()

Source from the content-addressed store, hash-verified

314
315// runDistributor distributes batches to subscribers
316func (wm *watchManager) runDistributor() {
317 for {
318 select {
319 case batch, ok := <-wm.distributeChan:
320 if !ok {
321 return
322 }
323 _ = wm.distributeAllMessages(batch)
324
325 case <-wm.workerCtx.Done():
326 // drain the distribute channel
327 for {
328 select {
329 case batch, ok := <-wm.distributeChan:
330 if !ok {
331 return
332 }
333 _ = wm.distributeAllMessages(batch)
334 default:
335 return
336 }
337 }
338 }
339 }
340}
341
342// runVictimCollector collects the victim buckets from the victim channel
343// and handle delete bucket operation

Callers 1

startDistributorMethod · 0.95

Calls 2

distributeAllMessagesMethod · 0.95
DoneMethod · 0.45

Tested by

no test coverage detected