Observable.
empty
(scheduler=None)create an Observable that emits no items but terminates normally
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.
--------------------------
Observable.empty();
----------------------------
Observable.
never
()create an Observable that emits no items and does not terminate
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.
--------------------------------------------------
Observable.never();
--------------------------------------------------
- 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. Ifnot 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. Ifnot specified, defaults to ImmediateScheduler.Returns the observable sequence that terminates exceptionally with the specified exception object.
-
- ------------------------------
- -----------------------------
No comments:
Post a Comment