code: func (ed *Dispatcher) Start() error {
  	if !ed.setState(dispatcherStateInitial, dispatcherStateStarted) {
  		return errors.New("cannot start dispatcher since it's not in its initial state")
  	}
  
  	ed.RegisterHandlers()
  
  	if err := ed.initRegistrations(); err != nil {
  		return errors.WithMessage(err, "error initializing registrations")
  	}
  
  	if ed.initialLastBlockNum > 0 {
  		if err := ed.updateLastBlockNum(ed.initialLastBlockNum); err != nil {
  			logger.Warnf("Unable to update last block num to %d: %s", ed.initialLastBlockNum, err)
  		}
  	}
  
  	go func() {
  		for {
  			if ed.getState() == dispatcherStateStopped {
  				break
  			}
  
  			logger.Debug("Listening for events...")
  			e, ok := <-ed.eventch
  			if !ok {
  				break
  			}
  
  			logger.Debugf("Received event: %+v", reflect.TypeOf(e))
  
  			if handler, ok := ed.handlers[reflect.TypeOf(e)]; ok {
  				logger.Debugf("Dispatching event: %+v", reflect.TypeOf(e))
  				handler(e)
  			} else {
  				logger.Errorf("Handler not found for: %s", reflect.TypeOf(e))
  			}
  		}
  		logger.Debug("Exiting event dispatcher")
  	}()
  	return nil
  }
docs: // Start starts dispatching events as they arrive. All events are processed in
  // a single Go routine in order to avoid any race conditions