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 TypeMethodDescriptionconnectTo
(EventStream<? extends T> source) Connects this connectable object tosource
event stream.
-
Method Details
-
connectTo
Connects this connectable object tosource
event stream. Implementations of this method should subscribe tosource
lazily, i.e. only subscribe tosource
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
.
-