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

Method Stop

watch_manager.go:644–660  ·  view source on GitHub ↗

Stop stops the watch manager Notifies all subscribers that the database is closing and closes all subscription channels Implements Component interface

(timeout time.Duration)

Source from the content-addressed store, hash-verified

642// Notifies all subscribers that the database is closing and closes all subscription channels
643// Implements Component interface
644func (wm *watchManager) Stop(timeout time.Duration) (err error) {
645 closeChan := make(chan struct{})
646
647 // close watch manager
648 // this cancels context and signals all goroutines to stop
649 go func() {
650 err = wm.close()
651 close(closeChan)
652 }()
653
654 select {
655 case <-closeChan:
656 return err
657 case <-time.After(timeout):
658 return ErrCloseWatchManagerTimeout
659 }
660}

Callers

nothing calls this directly

Calls 1

closeMethod · 0.95

Tested by

no test coverage detected