Top Inners Fields Constructors Methods
rx.internal.operators

public final Class OperatorReplay<T>

extends ConnectableObservable<T>
implements Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription
Imports
java.util.*, java.util.concurrent.TimeUnit, java.util.concurrent.atomic.*, rx.*, .Observable, rx.exceptions.*, rx.functions.*, rx.internal.util.OpenHashSet, rx.observables.ConnectableObservable, rx.schedulers.Timestamped, rx.subscriptions.Subscriptions

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
OperatorReplay.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
OperatorReplay.InnerProducer<
the value type
T
>

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

pack-priv static class
OperatorReplay.Node

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

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

The interface for interacting with various buffering logic.

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

Size and time bound replay buffer.

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

A bounded replay buffer implementation with size limit only.

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

Holds an unbounded list of events.

Field Summary

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

A factory that creates the appropriate buffer for the ReplaySubscriber.

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

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

pack-priv static final Func0<R>
pack-priv final Observable<? extends T>
source

The source observable.

Constructor Summary

AccessConstructor and Description
private
OperatorReplay(Observable.OnSubscribe<T> onSubscribe, Observable<? extends T> source, final AtomicReference<OperatorReplay.ReplaySubscriber<T>> current, final Func0<? extends OperatorReplay.ReplayBuffer<T>> bufferFactory)

Method Summary

Modifier and TypeMethod and Description
public void
connect(Action1<? super Subscription>
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 rx.observables.ConnectableObservable.connect.

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

Returns:

the replaying ConnectableObservable
create
(Observable<? extends T>
the source Observable
source
)

Creates a replaying ConnectableObservable with an unbounded buffer.

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

Returns:

the replaying ConnectableObservable
create
(Observable<? extends T>
the source Observable
source
,
final int
the maximum number of elements buffered
bufferSize
)

Creates a replaying ConnectableObservable with a size bound buffer.

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

Returns:

the replaying ConnectableObservable
create
(Observable<? extends T>
the source Observable
source
,
long
the maximum age (exclusive) of each item when timestamped with the given scheduler
maxAge
,
TimeUnit
the time unit of the maximum age
unit
,
Scheduler
the scheduler providing the notion of current time
scheduler
)

Creates a replaying ConnectableObservable with a time bound buffer.

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

Returns:

the replaying ConnectableObservable
create
(Observable<? extends T>
the source Observable
source
,
long
the maximum age (exclusive) of each item when timestamped with the given scheduler
maxAge
,
TimeUnit
the time unit of the maximum age
unit
,
final Scheduler
the scheduler providing the notion of current time
scheduler
,
final int
the maximum number of elements buffered
bufferSize
)

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

pack-priv static <T> ConnectableObservable<T>

Returns:

the connectable observable
create
(Observable<? extends T>
the source observable
source
,
final Func0<? extends OperatorReplay.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 boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public static <
the upstream's value type
T
,
the intermediate value type of the ConnectableObservable
U
,
the final value type provided by the selector function
R
>
Observable<R>

Returns:

the Observable multicasting over a transformation of a ConnectableObservable
multicastSelector
(final Func0<? extends ConnectableObservable<U>>
the factory that returns a ConnectableObservable instance
connectableFactory
,
final Func1<? super Observable<U>, ? extends Observable<R>>
the function applied on the ConnectableObservable and returns the Observable the downstream will subscribe to.
selector
)

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

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

Returns:

the ConnectableObservable instance that is observed on the specified scheduler
observeOn
(final ConnectableObservable<T>
the ConnectableObservable to schedule on the specified scheduler
co
,
final Scheduler
the target Scheduler instance
scheduler
)

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

public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from rx.observables.ConnectableObservable:
autoConnectautoConnectautoConnectconnectrefCount