Package org.reactfx

Class EventSource<T>

Type Parameters:
T - type of values this EventSource accepts and emits.
All Implemented Interfaces:
EventSink<T>, EventStream<T>, Observable<Consumer<? super T>>, ProperEventStream<T>, ProperObservable<Consumer<? super T>,T>

public class EventSource<T> extends EventStreamBase<T> implements EventSink<T>
EventSource is an EventSink that serves also as an EventStream - every value pushed to EventSource is immediately emitted by it.
  • Constructor Details

    • EventSource

      public EventSource()
  • Method Details

    • push

      public final void push(T value)
      Make this event stream immediately emit the given value.
      Specified by:
      push in interface EventSink<T>
    • observeInputs

      protected final Subscription observeInputs()
      Description copied from class: ObservableBase
      Starts observing this observable's input(s), if any. This method is called when the number of observers goes from 0 to 1. This method is called before ObservableBase.newObserver(Object) is called for the first observer.
      Specified by:
      observeInputs in class ObservableBase<Consumer<? super T>,T>
      Returns:
      subscription used to stop observing inputs. The subscription is unsubscribed (i.e. input observation stops) when the number of observers goes down to 0.