func (l *Lobster) Fire(event string, data interface{}) (bool, Output) {
	for _, listener := range l.eventMap[event].Listener {
		l.waitGroup.Add(1)
		go listener.Construct().Handle(l, data)
	}

	l.waitGroup.Wait()

	var errors []exceptions.RoutineException
	var criticalErrors []exceptions.RoutineException
	for exception := range l.channel {
		errors = append(errors, exception)
		if exception.Critical {
			criticalErrors = append(criticalErrors, exception)
		}
	}

	if len(criticalErrors) > 0 {
		if RollBack := l.eventMap[event].RollBack; RollBack != nil {
			RollBack(data, criticalErrors)
		}

		sentry.CaptureRoutineException(errors)

		return false, l.output
	}

	if len(errors) > 0 {
		sentry.CaptureRoutineException(errors)
	}

	return true, l.output
}
// Fire runs the event listeners assigned to given event.
Fire runs the event listeners assigned to given event.
// Fire runs the event listeners assigned to given event .
func (l *Lobster) Fire(event string, data interface{}) (bool, Output) {
	for _, listener := range l.eventMap[event].Listener {
		l.waitGroup.Add(1)
		go listener.Construct().Handle(l, data)
	}
	l.waitGroup.Wait()
	var errors []exceptions.RoutineException
	var criticalErrors []exceptions.RoutineException
	for exception := range l.channel {
		errors = append(errors, exception)
		if exception.Critical {
			criticalErrors = append(criticalErrors, exception)
		}
	}
	if len(criticalErrors) > 0 {
		if RollBack := l.eventMap[event].RollBack; RollBack != nil {
			RollBack(data, criticalErrors)
		}
		sentry.CaptureRoutineException(errors)
		return false, l.output
	}
	if len(errors) > 0 {
		sentry.CaptureRoutineException(errors)
	}
	return true, l.output
}
func ( l * Lobster ) Fire ( event string , data interface { } ) ( bool , Output ) { for _ , listener := range l . eventMap [ event ] . Listener { l . waitGroup . Add ( 1 ) go listener . Construct ( ) . Handle ( l , data ) } l . waitGroup . Wait ( ) var errors [ ] exceptions . RoutineException var criticalErrors [ ] exceptions . RoutineException for exception := range l . channel { errors = append ( errors , exception ) if exception . Critical { criticalErrors = append ( criticalErrors , exception ) } } if len ( criticalErrors ) > 0 { if RollBack := l . eventMap [ event ] . RollBack ; RollBack != nil { RollBack ( data , criticalErrors ) } sentry . CaptureRoutineException ( errors ) return false , l . output } if len ( errors ) > 0 { sentry . CaptureRoutineException ( errors ) } return true , l . output }
Fire runs the event listeners assigned to given event.
Fire runs the event listeners assigned to given event .