Beispiel #1
0
        async def subscribe_async(
                aobv: AsyncObserver[TSource]) -> AsyncDisposable:
            disposable = AsyncDisposable.empty()

            async def action(source: AsyncObservable[TSource]) -> None:
                nonlocal disposable

                async def asend(value: TSource) -> None:
                    await aobv.asend(value)

                async def athrow(error: Exception) -> None:
                    next_source = handler(error)
                    await action(next_source)

                async def aclose() -> None:
                    await aobv.aclose()

                _obv = AsyncAnonymousObserver(asend, athrow, aclose)

                await disposable.dispose_async()
                subscription = await source.subscribe_async(_obv)
                disposable = subscription

            await action(source)

            return AsyncDisposable.create(disposable.dispose_async)
Beispiel #2
0
 async def subscribe_async(aobv: AsyncObserver[Any]) -> AsyncDisposable:
     await aobv.aclose()
     return AsyncDisposable.empty()
Beispiel #3
0
 async def subscribe_async(_: AsyncObserver[Any]) -> AsyncDisposable:
     return AsyncDisposable.empty()
Beispiel #4
0
    async def subscribe_async(aobv: AsyncObserver[TSource]) -> AsyncDisposable:
        safe_obv = safe_observer(aobv, AsyncDisposable.empty())

        await safe_obv.asend(value)
        await safe_obv.aclose()
        return AsyncDisposable.empty()