-
- All Implemented Interfaces:
-
com.tds.common.reactor.Subscription
public class RxRingBuffer implements Subscription
This assumes Spsc or Spmc usage. This means only a single producer calling the on* methods. This is the Rx contract of an Observer (see http://reactivex.io/documentation/contract.html). Concurrent invocations of on* methods will not be thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description public volatile ObjectterminalStatepublic final static intSIZE
-
Method Summary
Modifier and Type Method Description static RxRingBuffergetSpscInstance()static RxRingBuffergetSpmcInstance()synchronized voidrelease()voidunsubscribe()Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received. voidonNext(Object o)voidonCompleted()voidonError(Throwable t)intavailable()intcapacity()intcount()booleanisEmpty()Objectpoll()Objectpeek()booleanisCompleted(Object o)booleanisError(Object o)ObjectgetValue(Object o)booleanaccept(Object o, Observer child)ThrowableasError(Object o)booleanisUnsubscribed()Indicates whether this {@code Subscription}is currently unsubscribed.-
-
Method Detail
-
getSpscInstance
static RxRingBuffer getSpscInstance()
-
getSpmcInstance
static RxRingBuffer getSpmcInstance()
-
release
synchronized void release()
-
unsubscribe
void unsubscribe()
Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received.
This allows deregistering an Subscriber before it has finished receiving all events (i.e. beforeonCompleted is called).
-
onCompleted
void onCompleted()
-
available
int available()
-
capacity
int capacity()
-
count
int count()
-
isEmpty
boolean isEmpty()
-
isCompleted
boolean isCompleted(Object o)
-
isUnsubscribed
boolean isUnsubscribed()
Indicates whether this
{@code Subscription}is currently unsubscribed.
-
-
-
-