event_controller.go
func (e *EventController) Emit(b EventBody) (int, error) {
	// int used to count the number of Handlers fired.
	var i int
	// We build an event struct to contain the Body and generate a Header.
	event := Event{Header: generateHeader(), Body: b}

	// Fire a gorountine for each handler.
	// By design the is no waiting for any Handlers to complete
	// before firing another. Therefore there is also no guarantee
	// that any Handler will predictably fire before another one.
	//
	// Any synchronizing needs to be within the Handler.
	for _, h := range e.Handlers {
		i++
		go h.HandleGomitEvent(event)
	}

	return i, nil
}
func (e *EventController) Emit(b EventBody) (int, error) {
	// int used to count the number of Handlers fired.
	var i int
	// We build an event struct to contain the Body and generate a Header.
	event := Event{Header: generateHeader(), Body: b}

	// Fire a gorountine for each handler.
	// By design the is no waiting for any Handlers to complete
	// before firing another. Therefore there is also no guarantee
	// that any Handler will predictably fire before another one.
	//
	// Any synchronizing needs to be within the Handler.
	for _, h := range e.Handlers {
		i++
		go h.HandleGomitEvent(event)
	}

	return i, nil
}
// Emits an Event from the EventController. Takes an EventBody which is used
// to build an Event. Returns number of handlers that
// received the event and error if an error was raised.