code: func (m *SubscriptionManager) subscriptionHandler() {
  	defer m.wg.Done()
  
  	for {
  		select {
  		// A new subscription request has been received from a client.
  		case msg := <-m.newSubscriptions:
  			msg.errChan <- m.handleNewSubscription(msg)
  
  		// A request to cancel an existing subscription has been
  		// received from a client.
  		case msg := <-m.cancelSubscriptions:
  			m.handleCancelSubscription(msg)
  
  		// A new block notification for the tip of the chain has been
  		// received from the backing NotificationSource.
  		case ntfn, ok := <-m.ntfnSource.Notifications():
  			if !ok {
  				log.Warn("Block source is unable to deliver " +
  					"new updates")
  				return
  			}
  
  			m.notifySubscribers(ntfn)
  
  		case <-m.quit:
  			return
  		}
  	}
  }
docs: // subscriptionHandler is the main event handler of the SubscriptionManager.
  // It's responsible for atomically handling notifications for new blocks and
  // creating/removing client block subscriptions.
  //
  // NOTE: This must be run as a goroutine.