Empty-never-throw

See also

classmethod Observable.empty(scheduler=None)

Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.

1 - res = rx.Observable.empty() 2 - res = rx.Observable.empty(rx.Scheduler.timeout)

scheduler – Scheduler to send the termination call on.

Returns an observable sequence with no elements.

../../_images/empty.png
classmethod Observable.never()

Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).

Returns an observable sequence whose observers will never get called.

../../_images/never.png
classmethod Observable.throw(exception, scheduler=None)

Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message.

1 - res = rx.Observable.throw_exception(Exception(‘Error’)) 2 - res = rx.Observable.throw_exception(Exception(‘Error’),

rx.Scheduler.timeout)

Keyword arguments: exception – An object used for the sequence’s termination. scheduler – Scheduler to send the exceptional termination call on. If

not specified, defaults to ImmediateScheduler.

Returns the observable sequence that terminates exceptionally with the specified exception object.

classmethod Observable.throw_exception(exception, scheduler=None)

Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message.

1 - res = rx.Observable.throw_exception(Exception(‘Error’)) 2 - res = rx.Observable.throw_exception(Exception(‘Error’),

rx.Scheduler.timeout)

Keyword arguments: exception – An object used for the sequence’s termination. scheduler – Scheduler to send the exceptional termination call on. If

not specified, defaults to ImmediateScheduler.

Returns the observable sequence that terminates exceptionally with the specified exception object.