Class Input<T extends Buffer>

Type Parameters:
T - the type of data used in this event
All Implemented Interfaces:
Future<Void>, Associator, Eligible

public final class Input<T extends Buffer> extends IOEvent<T>
This event signals that a new chunk of data has successfully been obtained from some source.

This type of event is commonly used for data flowing into the application.

  • Method Details

    • fromSource

      public static <B extends Buffer> Input<B> fromSource(ManagedBuffer<B> buffer, boolean endOfRecord)
      Create a new event with the given buffer.

      The buffer must have been prepared for invoking get-methods.

      Parameters:
      buffer - the buffer with the data
      endOfRecord - if the event ends a data record
    • fromSink

      public static <B extends Buffer> Input<B> fromSink(ManagedBuffer<B> buffer, boolean endOfRecord)
      Create a new event with the given buffer.

      Creating the event flips the buffer, which is assumed to have been used for collecting data up to now.

      Parameters:
      buffer - the buffer with the data
      endOfRecord - if the event ends a data record