disposable

All Disposables implement the Disposable interface which requires from them only a dispose() method. The abstract base class that all Disposable classes inherit from is Cancelable which provides the property isDisposed to check if a Disposable has already been disposed.

class rx.disposable.Disposable

Represents a disposable object

dispose()

Disposes the current object. It is assumed from all classes that implement dispose(), that the mothod can be called multiple times with the side effect of disposing only occuring once.

static create(action)

create() returns a Cancelable that calls action at the first call to dispose().

static empty()

empty() returns a Disposable that does nothing on dispose().

class rx.disposable.Cancelable

Inherits Disposable and adds the isDisposed attribute.

class rx.disposable.AnonymouseDisposable(action)

Represents a disposable resource that wraps an action that is called on the first use of dispose().

isDisposed

Returns True if dispose() was called at least once.

class rx.disposable.BooleanDisposable

Represents a disposable resource that can be checked if it already has been disposed

class rx.disposable.CompositeDisposable(*disposables)

Represents a group of disposable resources that are disposed together

add(disposable)

Adds disposable to the CompositeDisposable and disposes disposable if it is already disposed.

contains(disposable)

Returns True if the disposable is contained in the CompositeDisposable.

remove(disposable)

Removes the disposable from the CompositeDisposable and disposes it. Returns False if disposable has not been found otherwise True.

clear()

Removes all disposables from the CompositeDisposable and disposes them.

class rx.disposable.RefCountDisposable(disposable)

Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.

class rx.disposable.SchedulerDisposable(scheduler, disposable)

Represents a disposable resource whose disposal invocation will be scheduled on the specified Scheduler.

getDisposable()

Returns a Disposable that has a reference to this instance.

class rx.disposable.SerialDisposable

Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. Also known as MultipleAssignmentDisposable.

disposable

The current Disposable. Assigning a new Disposable disposes the current Disposable and sets the new as the current.

class rx.disposable.SingleAssignmentDisposable

Represents a disposable resource which only allows a single assignment of its underlying disposable resource. If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error.

disposable

The current Disposable. Assigning this property more than once raises an Exception.

Previous topic

Welcome to RxPython’s documentation!

Next topic

internal

This Page