@extensionmethod(Observable)
def to_future(self, future_ctor=None):

    future_ctor = future_ctor or rx.config.get("Future")
    if not future_ctor:
        raise Exception('Future type not provided nor in rx.config.Future')

    source = self

    future = future_ctor()

    value = [None]
    has_value = [False]

    def on_next(v):
        value[0] = v
        has_value[0] = True

    def on_error(err):
        future.set_exception(err)

    def on_completed():
        if has_value[0]:
            future.set_result(value[0])

    source.subscribe(on_next, on_error, on_completed)

    # No cancellation can be done
    return future
Mock version of System stats always returns fixed values.
dataset/ETHPy150Open ReactiveX/RxPY/rx/linq/observable/tofuture.py/to_future--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/system/system_stub.py/SystemServiceStub._Dynamic_GetSystemStats