Package org.reactfx
Class ConnectableEventSource<T>
java.lang.Object
org.reactfx.ObservableBase<Consumer<? super T>,T>
org.reactfx.EventStreamBase<T>
org.reactfx.ConnectableEventSource<T>
- All Implemented Interfaces:
Connectable<T>
,ConnectableEventSink<T>
,ConnectableEventStream<T>
,EventSink<T>
,EventStream<T>
,Observable<Consumer<? super T>>
,ProperEventStream<T>
,ProperObservable<Consumer<? super T>,
T>
public final class ConnectableEventSource<T>
extends EventStreamBase<T>
implements ConnectableEventStream<T>, ConnectableEventSink<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnectTo
(EventStream<? extends T> input) Connects this connectable object tosource
event stream.protected final Subscription
Starts observing this observable's input(s), if any.final void
private final Subscription
subscribeToInput
(EventStream<? extends T> input) Methods inherited from class org.reactfx.ObservableBase
addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, newObserver, notifyObservers, notifyObservers, observe, removeObserver, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.reactfx.EventStream
accumulate, accumulate, accumulate, accumulateBetween, accumulateBetween, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateWhen, accumulateWhen, accumulative, accumulative, cast, conditionOn, conditionOnShowing, distinct, emitBothOnEach, emitOn, emitOnEach, feedTo, feedTo, filter, filter, filterMap, filterMap, flatMap, forgetful, fork, guardedBy, hook, latestN, map, mapToCompletionStage, mapToTask, onRecurseAccumulate, onRecurseAccumulate, onRecurseQueue, onRecurseReduce, onRecurseRetainLatest, or, pausable, pauseWhen, pin, queueBetween, queueUntilLater, queueUntilLater, reduceBetween, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceUntilLater, reduceUntilLater, reduceWhen, reducible, repeatOn, retainLatestBetween, retainLatestUntilLater, retainLatestUntilLater, retainLatestWhen, splitBy, subscribe, subscribeFor, subscribeForOne, successionEnds, successionEnds, supply, supply, supplyCompletionStage, supplyTask, suppressible, suppressWhen, suspenderOf, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenIgnoreFor, thenIgnoreFor, thenReduceFor, thenReduceFor, thenRetainLatestFor, thenRetainLatestFor, threadBridge, threadBridgeFromFx, threadBridgeToFx, toBinding, withDefaultEvent
Methods inherited from interface org.reactfx.Observable
addObserver, observe, removeObserver
Methods inherited from interface org.reactfx.ProperEventStream
defaultNotificationAccumulator, emit
Methods inherited from interface org.reactfx.ProperObservable
defaultEquals, defaultHashCode, defaultToString, notifyObservers
-
Field Details
-
subscriptions
-
-
Constructor Details
-
ConnectableEventSource
public ConnectableEventSource()
-
-
Method Details
-
push
-
connectTo
Description copied from interface:Connectable
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.- Specified by:
connectTo
in interfaceConnectable<T>
- Parameters:
input
- event stream to (lazily) connect to.- Returns:
- subscription that can be used to disconnect this connectable
object from
source
.
-
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 beforeObservableBase.newObserver(Object)
is called for the first observer.- Specified by:
observeInputs
in classObservableBase<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.
-
subscribeToInput
-