Interface InputConsumer

All Known Implementing Classes:
JsonReader, LineCollector, ManagedBufferReader, ManagedBufferStreamer, WwwFormUrldecoder

public interface InputConsumer
May be implemented by classes that can consume input events to support generic usage.
Since:
2.8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default <W extends Buffer>
    void
    feed(Input<W> event)
    Calls feed(ManagedBuffer) with the provided event’s buffer.
    <W extends Buffer>
    void
    feed(ManagedBuffer<W> buffer)
    Feed data to the consumer.
  • Method Details

    • feed

      <W extends Buffer> void feed(ManagedBuffer<W> buffer)
      Feed data to the consumer.

      The call blocks while data from a previous invocation has not been fully read. The buffer passed as argument is locked (see ManagedBuffer.lockBuffer()) until all data has been consumed.

      Calling this method with null indicates the end of the feed.

      Parameters:
      buffer - the buffer
    • feed

      default <W extends Buffer> void feed(Input<W> event)
      Calls feed(ManagedBuffer) with the provided event’s buffer.

      Calling this method with null indicates the end of the feed.

      Parameters:
      event - the event