Beispiel #1
0
        private static async TaskLikeObservable <int> Test1()
        {
            var ob = await TaskLikeObservable <int> .Capture();

            await ob.Subscription.ConfigureAwait(false);

            ob.OnNext(1);

            ob.OnNext(2);

            ob.OnNext(3);

            return(ob.OnCompleted());
        }
Beispiel #2
0
        public static async TaskLikeObservable <string> Producer3()
        {
            var o = await TaskLikeObservable <string> .Capture();

            await o.Subscription;

            for (var i = 0; i < 10; i++)
            {
                o.OnNext("y" + i);

                await Task.Delay(100).ConfigureAwait(false);
            }

            return(o.OnCompleted());
        }