/**
 * This interface declares an out channel, which is a channel where we can
 * write data.
 * @author fpereira
 *
 * @param <E> The type of the data that is read.
 */
public interface OutChannel<E> {
  /**
   * Write the data into the channel.
   * @param data The data to be written.
   * @throws Exception in case we fail to write the data.
   */
  void write(E data) throws Exception;

  /**
   * Call it once we are done sending the data.
   * @throws Exception in case we fail to close the channel.
   */
  void done() throws Exception;
}
