Beispiel #1
0
    def __add__(self, other: 'AsyncObservable[T]') -> 'AsyncObservable[T]':
        """Pythonic version of concat

        Example:
        zs = xs + ys

        Returns concat(other, self)"""

        from aioreactive.operators.concat import concat
        return concat(self, other)
Beispiel #2
0
    def __iadd__(self, other: 'AsyncObservable[T]') -> 'AsyncObservable[T]':
        """Pythonic use of concat

        Example:
        xs += ys

        Returns self.concat(other, self)"""

        from aioreactive.operators.concat import concat
        return concat(self, other)
Beispiel #3
0
async def test_concat_happy():
    xs = from_iterable(range(5))
    ys = from_iterable(range(5, 10))
    result = []

    async def asend(value):
        log.debug("test_merge_done:send: ", value)
        result.append(value)

    zs = concat(xs, ys)

    await run(zs, AnonymousAsyncObserver(asend))
    assert result == list(range(10))