From¶
See also
- Official ReactiveX documentation: From
-
classmethod
Observable.
from_
(iterable, scheduler=None)¶ Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
1 - res = rx.Observable.from_iterable([1,2,3]) 2 - res = rx.Observable.from_iterable([1,2,3], rx.Scheduler.timeout)
Keyword arguments: :param Observable cls: Observable class :param Scheduler scheduler: [Optional] Scheduler to run the
enumeration of the input sequence on.Returns: The observable sequence whose elements are pulled from the given enumerable sequence. Return type: Observable
-
classmethod
Observable.
from_callback
(func, selector=None)¶ Converts a callback function to an observable sequence.
Keyword arguments: func – {Function} Function with a callback as the last parameter to
convert to an Observable sequence.- selector – {Function} [Optional] A selector which takes the arguments
- from the callback to produce a single item to yield on next.
Returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as a list.
-
classmethod
Observable.
from_future
(future)¶ Converts a Future to an Observable sequence
Keyword Arguments: future – {Future} A Python 3 compatible future.
Returns {Observable} An Observable sequence which wraps the existing future success and failure.
-
classmethod
Observable.
from_iterable
(iterable, scheduler=None)¶ Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
1 - res = rx.Observable.from_iterable([1,2,3]) 2 - res = rx.Observable.from_iterable([1,2,3], rx.Scheduler.timeout)
Keyword arguments: :param Observable cls: Observable class :param Scheduler scheduler: [Optional] Scheduler to run the
enumeration of the input sequence on.Returns: The observable sequence whose elements are pulled from the given enumerable sequence. Return type: Observable
-
classmethod
Observable.
from_list
(iterable, scheduler=None)¶ Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
1 - res = rx.Observable.from_iterable([1,2,3]) 2 - res = rx.Observable.from_iterable([1,2,3], rx.Scheduler.timeout)
Keyword arguments: :param Observable cls: Observable class :param Scheduler scheduler: [Optional] Scheduler to run the
enumeration of the input sequence on.Returns: The observable sequence whose elements are pulled from the given enumerable sequence. Return type: Observable
-
classmethod
Observable.
of
(*args, **kwargs)¶ This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
Example: res = rx.Observable.of(1,2,3)
Returns the observable sequence whose elements are pulled from the given arguments