func (ep *EventPublisher) Publish(nc *nats.EncodedConn) error {
	for _, e := range ep.events {
		err := e.Publish(nc)
		if err != nil {
			return fmt.Errorf("event publisher: error publishing event: %s [%v]", e.Name(), err)
		}
	}
	return nil
}
// Publish publishes the added events to registered NATS subjects
// if error occurs while publishing any event, the publisher returns the error
// immediately instead of try publishing other events
Publish publishes the added events to registered NATS subjects
if error occurs while publishing any event, the publisher returns the error
immediately instead of try publishing other events
// Publish publishes the added events to registered NATS subjects // if error occurs while publishing any event the publisher returns the error // immediately instead of try publishing other events
func (ep *EventPublisher) Publish(nc *nats.EncodedConn) error {
	for _, e := range ep.events {
		err := e.Publish(nc)
		if err != nil {
			return fmt.Errorf("event publisher: error publishing event: %s [%v]", e.Name(), err)
		}
	}
	return nil
}
func ( ep * EventPublisher ) Publish ( nc * nats . EncodedConn ) error { for _ , e := range ep . events { err := e . Publish ( nc ) if err != nil { return fmt . Errorf ( " " , e . Name ( ) , err ) } } return nil }
Publish publishes the added events to registered NATS subjects
if error occurs while publishing any event, the publisher returns the error
immediately instead of try publishing other events
Publish publishes the added events to registered NATS subjects if error occurs while publishing any event the publisher returns the error immediately instead of try publishing other events