Top Inners Fields Constructors Methods
io.reactivex.internal.operators.flowable

public final Class FlowableReplay<T>

extends ConnectableFlowable<T>
implements HasUpstreamPublisher<T>, ResettableConnectable
Class Inheritance
All Implemented Interfaces
io.reactivex.internal.disposables.ResettableConnectable, io.reactivex.internal.fuseable.HasUpstreamPublisher
Imports
java.util.*, java.util.concurrent.*, java.util.concurrent.atomic.*, org.reactivestreams.*, io.reactivex.*, io.reactivex.disposables.Disposable, io.reactivex.exceptions.Exceptions, io.reactivex.flowables.ConnectableFlowable, io.reactivex.functions.*, io.reactivex.internal.disposables.ResettableConnectable, io.reactivex.internal.functions.ObjectHelper, io.reactivex.internal.fuseable.HasUpstreamPublisher, io.reactivex.internal.subscribers.SubscriberResourceWrapper, io.reactivex.internal.subscriptions.*, io.reactivex.internal.util.*, io.reactivex.plugins.RxJavaPlugins, io.reactivex.schedulers.Timed

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
FlowableReplay.BoundedReplayBuffer<
the value type
T
>

Base class for bounded buffering with options to specify an enter and leave transforms and custom truncation behavior.

pack-priv static class
pack-priv static class
pack-priv static class
FlowableReplay.InnerSubscription<
the value type
T
>

A Subscription that manages the request and cancellation state of a child subscriber in thread-safe manner.

pack-priv static class
pack-priv static class
FlowableReplay.Node

Represents a node in a bounded replay buffer's linked list.

pack-priv static interface
FlowableReplay.ReplayBuffer<
the value type
T
>

The interface for interacting with various buffering logic.

pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
FlowableReplay.SizeAndTimeBoundReplayBuffer<
the buffered value type
T
>

Size and time bound replay buffer.

pack-priv static class
FlowableReplay.SizeBoundReplayBuffer<
the value type
T
>

A bounded replay buffer implementation with size limit only.

pack-priv static class
FlowableReplay.UnboundedReplayBuffer<
the value type
T
>

Holds an unbounded list of events.

Field Summary

Modifier and TypeField and Description
pack-priv final Callable<? extends FlowableReplay.ReplayBuffer<T>>
bufferFactory

A factory that creates the appropriate buffer for the ReplaySubscriber.

pack-priv final AtomicReference<FlowableReplay.ReplaySubscriber<T>>
current

Holds the current subscriber that is, will be or just was subscribed to the source observable.

pack-priv static final Callable<V>
pack-priv final Publisher<T>
pack-priv final Flowable<T>
source

The source observable.

Constructor Summary

AccessConstructor and Description
private
FlowableReplay(Publisher<T> onSubscribe, Flowable<T> source, final AtomicReference<FlowableReplay.ReplaySubscriber<T>> current, final Callable<? extends FlowableReplay.ReplayBuffer<T>> bufferFactory)

Method Summary

Modifier and TypeMethod and Description
public void
connect(Consumer<? super Disposable>
the action that receives the connection subscription before the subscription to source happens allowing the caller to synchronously disconnect a synchronous source
connection
)

Implements abstract io.reactivex.flowables.ConnectableFlowable.connect.

Instructs the ConnectableFlowable to begin emitting the items from its underlying Flowable to its Subscribers.
public static <
the value type
T
>
ConnectableFlowable<T>

Returns:

the new ConnectableObservable instance
create
(Flowable<T>
the source Flowable to use
source
,
final int
the maximum number of elements to hold
bufferSize
)

Creates a replaying ConnectableObservable with a size bound buffer.

public static <
the value type
T
>
ConnectableFlowable<T>

Returns:

the new ConnectableObservable instance
create
(Flowable<T>
the source Flowable to use
source
,
long
the maximum age of entries
maxAge
,
TimeUnit
the unit of measure of the age amount
unit
,
Scheduler
the target scheduler providing the current time
scheduler
)

Creates a replaying ConnectableObservable with a time bound buffer.

public static <
the value type
T
>
ConnectableFlowable<T>

Returns:

the new ConnectableFlowable instance
create
(Flowable<T>
the source Flowable to use
source
,
final long
the maximum age of entries
maxAge
,
final TimeUnit
the unit of measure of the age amount
unit
,
final Scheduler
the target scheduler providing the current time
scheduler
,
final int
the maximum number of elements to hold
bufferSize
)

Creates a replaying ConnectableObservable with a size and time bound buffer.

pack-priv static <T> ConnectableFlowable<T>

Returns:

the connectable observable
create
(Flowable<T>
the source observable
source
,
final Callable<? extends FlowableReplay.ReplayBuffer<T>>
the factory to instantiate the appropriate buffer when the observable becomes active
bufferFactory
)

Creates a OperatorReplay instance to replay values of the given source observable.

public static <
the value type
T
>
ConnectableFlowable<T>

Returns:

the new ConnectableObservable instance
createFrom
(Flowable<? extends T>
the source Publisher to use
source
)

Creates a replaying ConnectableObservable with an unbounded buffer.

public static <
the connectable observable type
U
,
the result type
R
>
Flowable<R>

Returns:

the new Observable instance
multicastSelector
(final Callable<? extends ConnectableFlowable<U>>
the factory that returns a ConnectableFlowable for each individual subscriber
connectableFactory
,
final Function<? super Flowable<U>, ? extends Publisher<R>>
the function that receives a Flowable and should return another Flowable that will be subscribed to
selector
)

Given a connectable observable factory, it multicasts over the generated ConnectableObservable via a selector function.

public static <
the value type
T
>
ConnectableFlowable<T>

Returns:

the new ConnectableObservable instance
observeOn
(final ConnectableFlowable<T>
the ConnectableFlowable to wrap
cf
,
final Scheduler
the target scheduler
scheduler
)

Child Subscribers will observe the events of the ConnectableObservable on the specified scheduler.

public void
resetIf(Disposable
the disposable received from a previous connect() call.
connectionObject
)

Implements io.reactivex.internal.disposables.ResettableConnectable.resetIf.

Reset the connectable source only if the given Disposable connection instance is still representing a connection established by a previous connect() connection.
public Publisher<T>
source()

Implements io.reactivex.internal.fuseable.HasUpstreamPublisher.source.

Returns the source Publisher.
protected void
subscribeActual(Subscriber<? super T>
the incoming Subscriber, never null
s
)

Implements abstract io.reactivex.Flowable.subscribeActual.

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.
Inherited from io.reactivex.flowables.ConnectableFlowable:
autoConnectautoConnectautoConnectconnectrefCountrefCountrefCountrefCountrefCountrefCount