def trigger(event_name, payload = {})
      handlers.each do |handler|
        next unless handler.respond_to?(:trigger)

        handler.trigger(self, event_name, payload)
      end
    end
def trigger(event_name, payload = {})
      handlers.each do |handler|
        next unless handler.respond_to?(:trigger)

        handler.trigger(self, event_name, payload)
      end
    end
Triggers an event, instructing all registered handlers to invoke any
 methods subscribed to the event, and passing them a payload hash of
 arbitrary data.
 @param event_name [String, Symbol] The name of the event to trigger.
 @param payload [Hash] An optional hash of arbitrary data.
 @return [void]