Top Description Fields Constructors Methods
io.reactivex.rxjava3.internal.subscriptions

public final Class BooleanSubscription

extends AtomicBoolean
implements Subscription
Class Inheritance
All Implemented Interfaces
org.reactivestreams.Subscription
Imports
java.util.concurrent.atomic.AtomicBoolean, org.reactivestreams.Subscription

Subscription implementation that ignores request but remembers the cancellation which can be checked via isCancelled.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
public boolean

Returns:

true if this BooleanSubscription has been cancelled
isCancelled
()

Returns true if this BooleanSubscription has been cancelled.

public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public String
toString()

Overrides java.util.concurrent.atomic.AtomicBoolean.toString.

Returns the String representation of the current value.
Inherited from java.util.concurrent.atomic.AtomicBoolean:
compareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndSetgetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleaseweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicBoolean.serialVersionUID.

Constructor Detail

BooleanSubscriptionback to summary
public BooleanSubscription()

Method Detail

cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
isCancelledback to summary
public boolean isCancelled()

Returns true if this BooleanSubscription has been cancelled.

Returns:boolean

true if this BooleanSubscription has been cancelled

requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.util.concurrent.atomic.AtomicBoolean.toString.

Doc from java.util.concurrent.atomic.AtomicBoolean.toString.

Returns the String representation of the current value.

Returns:String

the String representation of the current value

Annotations
@Override