caspia.reactive.operations package¶
Submodules¶
caspia.reactive.operations.cached module¶
-
class
caspia.reactive.operations.cached.cached(observable, loop=None)[source]¶ Bases:
caspia.reactive.observable.Observable-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
property
observable¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
caspia.reactive.operations.default module¶
-
class
caspia.reactive.operations.default.default(*values)[source]¶ Bases:
caspia.reactive.observable.Observable-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
caspia.reactive.operations.filter module¶
-
class
caspia.reactive.operations.filter.filter(lambda_, observable, mode='previous', **kwargs)[source]¶ Bases:
caspia.reactive.operations.cached.cached-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
property
observable¶
-
async
observe()¶ Return current value of the observable.
-
async
on_error(error, **kwargs)¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
caspia.reactive.operations.impuls module¶
-
class
caspia.reactive.operations.impuls.impuls(observable, map=<function impuls.<lambda>>, default=None)[source]¶ Bases:
caspia.reactive.value.Value-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
async
observe()¶ Return current value of the observable.
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
async
update(value, notify=True)¶
-
update_without_notification(value)¶
-
caspia.reactive.operations.lambda_ module¶
-
class
caspia.reactive.operations.lambda_.lambda_(lam, *args, desc=None)[source]¶ Bases:
caspia.reactive.observable.Observable-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
caspia.reactive.operations.lowpass module¶
-
class
caspia.reactive.operations.lowpass.Sample(time, value)¶ Bases:
tupleCreate new instance of Sample(time, value)
-
count()¶ Return number of occurrences of value.
-
index()¶ Return first index of value.
Raises ValueError if the value is not present.
-
property
time¶ Alias for field number 0
-
property
value¶ Alias for field number 1
-
-
class
caspia.reactive.operations.lowpass.lowpass(input_: caspia.reactive.observable.Observable, window=60, algorithm='mean', loop=None)[source]¶ Bases:
caspia.reactive.observable.Observable-
property
current_time¶
-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
property
caspia.reactive.operations.transition module¶
-
class
caspia.reactive.operations.transition.transition(observable, loop=None)[source]¶ Bases:
caspia.reactive.operations.cached.cached-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
property
observable¶
-
async
observe()¶ Return current value of the observable.
-
async
on_error(error, **kwargs)¶
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-