def write(event)
      @executor.post do
        begin
          # Silently abort writing if any filter (and thus the whole filter chain)
          # returned `false`.
          next false unless @filter_chain.call(event)
          @adapter.write @encoder.encode(event)
          true
        rescue Exception => exception
          log_error("write failed for adapter #{adapter.inspect}", exception, event)
          raise unless exception.is_a?(StandardError)
          raise if synchronous?
        end
      end
    end
def write(event)
      @executor.post do
        begin
          # Silently abort writing if any filter (and thus the whole filter chain)
          # returned `false`.
          next false unless @filter_chain.call(event)
          @adapter.write @encoder.encode(event)
          true
        rescue Exception => exception
          log_error("write failed for adapter #{adapter.inspect}", exception, event)
          raise unless exception.is_a?(StandardError)
          raise if synchronous?
        end
      end
    end
Filter, encode and write the given `event` to the configured {#adapter}.
 The given `event` is updated in-place by the filters and encoder of the
 flow and should not be re-used afterwards anymore.

 1. At first, we filter the event with the defined {#filter_chain} in their
    given order. If any of the filters returns `false`, the writing will be
    aborted. No further filters will be applied and the event will not be
    written to the adapter. See {FilterChain#call} for details.
 2. We encode the event to a format suitable for the adapter using the
    configured {#encoder}.
 3. Finally, the encoded event will be passed to the {#adapter} to be sent
    to the actual log target, e.g. a file or an external log receiver.

 Any error raised by a filter, the encoder, or the adapter when writing is
 logged to the {#error_flow}. If the current flow is {#synchronous?}, the
 error is re-raised.

 @param event [Hash] an event hash
 @return [Boolean] `true` if the event was written to the adapter, `false`
   otherwise