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

public final Enum EmptyDisposable

extends Enum<EmptyDisposable>
implements QueueDisposable<Object>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.operators.QueueDisposable, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.operators.QueueFuseable, io.reactivex.rxjava3.operators.SimpleQueue
Imports
io.reactivex.rxjava3.annotations.Nullable, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.operators.QueueDisposable

Represents a stateless empty Disposable that reports being always empty and disposed.

It is also async-fuseable but empty all the time.

Since EmptyDisposable implements QueueDisposable and is empty, don't use it in tests and then signal onNext with it; use Disposables.empty() instead.

Field Summary

Modifier and TypeField and Description
public static final EmptyDisposable
INSTANCE

Since EmptyDisposable implements QueueDisposable and is empty, don't use it in tests and then signal onNext with it; use Disposables.empty() instead.

public static final EmptyDisposable
NEVER

An empty disposable that returns false for isDisposed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.
public static void
complete(Observer<?> observer)

public static void
complete(MaybeObserver<?> observer)

public static void
public void
dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.
public static void
error(Throwable e, Observer<?> observer)

public static void
public static void
error(Throwable e, SingleObserver<?> observer)

public static void
error(Throwable e, MaybeObserver<?> observer)

public boolean
isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.
public boolean
isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Returns true if the queue is empty.
public boolean
offer(Object
the value to enqueue, not null
value
)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue a single value.
public boolean
offer(Object
the first value to enqueue, not null
v1
,
Object
the second value to enqueue, not null
v2
)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue two values.
public @Nullable Object
poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.
public int
requestFusion(int
the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).
mode
)

Implements io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.
public static EmptyDisposable
public static EmptyDisposable[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final EmptyDisposable INSTANCE

Since EmptyDisposable implements QueueDisposable and is empty, don't use it in tests and then signal onNext with it; use Disposables.empty() instead.

NEVERback to summary
public static final EmptyDisposable NEVER

An empty disposable that returns false for isDisposed.

Constructor Detail

EmptyDisposableback to summary
private EmptyDisposable()

Method Detail

clearback to summary
public void clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.

Annotations
@Override
completeback to summary
public static void complete(Observer<?> observer)
completeback to summary
public static void complete(MaybeObserver<?> observer)
completeback to summary
public static void complete(CompletableObserver observer)
disposeback to summary
public void dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Doc from io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.

Annotations
@Override
errorback to summary
public static void error(Throwable e, Observer<?> observer)
errorback to summary
public static void error(Throwable e, CompletableObserver observer)
errorback to summary
public static void error(Throwable e, SingleObserver<?> observer)
errorback to summary
public static void error(Throwable e, MaybeObserver<?> observer)
isDisposedback to summary
public boolean isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Doc from io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.

Returns:boolean

true if this resource has been disposed

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Returns true if the queue is empty.

Note however that due to potential fused functions in poll() it is possible this method returns false but then poll() returns null because the fused function swallowed the available item(s).

Returns:boolean

true if the queue is empty

Annotations
@Override
offerback to summary
public boolean offer(Object value)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue a single value.

Parameters
value:Object

the value to enqueue, not null

Returns:boolean

true if successful, false if the value was not enqueued likely due to reaching the queue capacity)

Annotations
@Override
offerback to summary
public boolean offer(Object v1, Object v2)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue two values.

Parameters
v1:Object

the first value to enqueue, not null

v2:Object

the second value to enqueue, not null

Returns:boolean

true if successful, false if the value was not enqueued likely due to reaching the queue capacity)

Annotations
@Override
pollback to summary
public @Nullable Object poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.

If the producer uses offer(Object, Object) and when polling in pairs, if the first poll() returns a non-null item, the second poll() is guaranteed to return a non-null item as well.

Returns:@Nullable Object

the item or null to indicate an empty queue

Annotations
@Nullable
@Override
requestFusionback to summary
public int requestFusion(int mode)

Implements io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Doc from io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.

This should be called before onSubscribe returns.

Calling this method multiple times or after onSubscribe finished is not allowed and may result in undefined behavior.

Parameters
mode:int

the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).

Returns:int

the established fusion mode: NONE, SYNC, ASYNC.

Annotations
@Override
valueOfback to summary
public static EmptyDisposable valueOf(String name)
valuesback to summary
public static EmptyDisposable[] values()