All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.thorbenkuck.network.stream.Source Maven / Gradle / Ivy

The newest version!
package com.github.thorbenkuck.network.stream;

import java.util.function.Consumer;

public interface Source {

  static  Source create() {
    return new DistributingSource<>();
  }

  default void onEmit(Consumer consumer) {
    onEmit(new SourceConsumer<>() {
      @Override
      public void onCancel() {}

      @Override
      public void accept(T t) {
        consumer.accept(t);
      }
    });
  }

  void push(T t);

  void onEmit(SourceConsumer consumer);

  void close();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy