예제 #1
0
파일: _buffer.py 프로젝트: lizh06/RxPY
def buffer_when_(
    closing_mapper: Callable[[], Observable[Any]]
) -> Callable[[Observable[_T]], Observable[List[_T]]]:
    return compose(
        ops.window_when(closing_mapper),
        ops.flat_map(ops.to_list()),
    )
예제 #2
0
파일: test_window.py 프로젝트: lizh06/RxPY
        def create():
            def closing():
                return reactivex.throw(ex)

            def mapper(w, i):
                return w.pipe(ops.map(lambda x: str(i) + " " + str(x)))

            return xs.pipe(
                ops.window_when(closing),
                ops.map_indexed(mapper),
                ops.merge_all(),
            )
예제 #3
0
파일: test_window.py 프로젝트: lizh06/RxPY
        def create():
            def closing():
                curr = window[0]
                window[0] += 1
                return reactivex.timer(curr * 100)

            def mapper(w, i):
                return w.pipe(ops.map(lambda x: str(i) + " " + str(x)))

            return xs.pipe(
                ops.window_when(closing),
                ops.map_indexed(mapper),
                ops.merge_all(),
            )