Package org.reactfx

Interface Connectable<T>

All Known Subinterfaces:
ConnectableEventSink<T>, ConnectableEventStream<T>
All Known Implementing Classes:
ConnectableEventSource

public interface Connectable<T>
Interface for objects that can be (lazily) connected to event streams. The semantics of a connection is left to the implementations of this interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    connectTo(EventStream<? extends T> source)
    Connects this connectable object to source event stream.
  • Method Details

    • connectTo

      Subscription connectTo(EventStream<? extends T> source)
      Connects this connectable object to source event stream. Implementations of this method should subscribe to source lazily, i.e. only subscribe to source when necessary, e.g. when the connectable object itself is being observed (e.g. itself has at least one subscriber).

      A Connectable may be connected to multiple sources at the same time.

      Parameters:
      source - event stream to (lazily) connect to.
      Returns:
      subscription that can be used to disconnect this connectable object from source.