def flush(event = nil)
      flows = to_a.delete_if(&:auto_flush?)
      return unless flows.any?

      event ||= yield if block_given?
      return unless event

      write_to(flows, event.to_h)
    end
def flush(event = nil)
      flows = to_a.delete_if(&:auto_flush?)
      return unless flows.any?

      event ||= yield if block_given?
      return unless event

      write_to(flows, event.to_h)
    end
Write an event `Hash` to each of the defined normal (that is: non
 `auto_flush`'ing) flows. The event is usually created from {Buffer#event}.

 We write a fresh deep-copy of the event hash to each defined {Flow}.
 This allows each flow to alter the event in any way without affecting the
 others.

 @param event [Hash, nil] the event `Hash`. See {Buffer#event} for details
 @yield [flow] If `event` is `nil`, we call the goven block and use its
   return value as the event. The block is expected to return an event
   `Hash`.
 @return [Hash, nil] the flushed event or `nil` if nothing was flushed