Exemplo n.º 1
0
        protected virtual async Task DefineObservers(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var consoleObserverFactory = (Expression <Func <IAsyncReactiveQbserver <T> > >)(() => new ConsoleObserver <T>().AsQbserver());
            var consoleObserver        = context.Provider.CreateQbserver <T>(consoleObserverFactory.Body);
            await context.DefineObserverAsync <T>(Platform.Constants.Identifiers.Observer.ConsoleObserver.Uri, consoleObserver, null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObserverAsync <string, T>(Platform.Constants.Identifiers.Observer.ConsoleObserverParam.Uri, prefix => new ConsoleObserver <T>(prefix).AsQbserver(), null, CancellationToken.None).ConfigureAwait(false);

            var traceObserverFactory = (Expression <Func <IAsyncReactiveQbserver <T> > >)(() => new TraceObserver <T>().AsQbserver());
            var traceObserver        = context.Provider.CreateQbserver <T>(traceObserverFactory.Body);
            await context.DefineObserverAsync <T>(Platform.Constants.Identifiers.Observer.TraceObserver.Uri, traceObserver, null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObserverAsync <string, T>(Platform.Constants.Identifiers.Observer.TraceObserverParam.Uri, prefix => new TraceObserver <T>(prefix).AsQbserver(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObserverAsync <Uri, T>(Platform.Constants.Identifiers.Observer.FireHose.Uri, uri => new FirehoseObserver <T>(uri).AsQbserver(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObserverAsync <string, T>(Platform.Constants.Identifiers.Observer.Throughput.Uri, s => new ThroughputObserver <T>(s).AsQbserver(), null, CancellationToken.None).ConfigureAwait(false);

            var nopObserverFactory = (Expression <Func <IAsyncReactiveQbserver <T> > >)(() => NopObserver <T> .Instance.AsQbserver());
            var nopObserver        = context.Provider.CreateQbserver <T>(nopObserverFactory.Body);
            await context.DefineObserverAsync <T>(new Uri(Client.Constants.Observer.Nop), nopObserver, null, CancellationToken.None).ConfigureAwait(false);
        }
Exemplo n.º 2
0
        protected override async Task DefineObservables(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await base.DefineObservables(context).ConfigureAwait(false);

            await context.UndefineObservableAsync(Platform.Constants.Identifiers.Observable.FireHose.Uri, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Platform.Constants.Identifiers.Observable.FireHose.Uri,
                topic => new TestFirehoseObservable <T>(topic).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Constants.Test.HotTimelineObservable.Uri,
                uri => new TimelineObservable <T>(uri, false).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Constants.Test.ColdTimelineObservable.Uri,
                uri => new TimelineObservable <T>(uri, true).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);
        }
Exemplo n.º 3
0
 public static IAsyncReactiveQbservable <NewsInfo> CreateNewsQbservable(ReactiveClientContext clientContext)
 {
     return
         (clientContext.GetObservable <NewsParameters, NewsInfo>(
              new Uri("bing://platform.bing.com/observable/real/newsinfo"))(
              new NewsParameters {
         SearchTerm = "bla", NotificationThresholdInSeconds = 10, TriggerImmediately = true
     }));
 }
Exemplo n.º 4
0
 protected virtual async Task UndefineObservers(ReactiveClientContext context)
 {
     await TryUndefine(() => context.UndefineObserverAsync(Reactor.Constants.Identifiers.Observer.Http.Uri, CancellationToken.None));
     await TryUndefine(() => context.UndefineObserverAsync(Reactor.Constants.Identifiers.Observer.HttpPost.Action.Uri, CancellationToken.None));
     await TryUndefine(() => context.UndefineObserverAsync(Reactor.Constants.Identifiers.Observer.Http.Action.Uri, CancellationToken.None));
     await TryUndefine(() => context.UndefineObserverAsync(Reactor.Constants.Identifiers.Observer.Http.Final.Uri, CancellationToken.None));
     await TryUndefine(() => context.UndefineObserverAsync(new Uri(Reactor.Constants.Identifiers.Observer.HttpPost.Final.WithHeaders), CancellationToken.None));
     await TryUndefine(() => context.UndefineObserverAsync(new Uri(Reactor.Constants.Identifiers.Observer.HttpPost.Final.NoHeaders), CancellationToken.None));
 }
Exemplo n.º 5
0
        public static IAsyncReactiveQbservable <CasiEvent> CreateCasiQbservable(ReactiveClientContext clientContext, long id, string firehoseUri)
        {
            string hoistedId = id.ToString();

            return
                (clientContext.GetObservable <CasiEvent>(new Uri(firehoseUri))
                 .Where(casiEvent => string.Equals(casiEvent.ItemId, hoistedId))
                 .DistinctUntilChanged(t => string.Format(CultureInfo.InvariantCulture, "{0}:{1}", t.Action, t.Environment)));
        }
Exemplo n.º 6
0
        protected virtual async Task UndefineObservables(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await TryUndefine(() => context.UndefineObservableAsync(Platform.Constants.Identifiers.Observable.FireHose.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(Platform.Constants.Identifiers.Observable.GarbageCollector.Uri, CancellationToken.None)).ConfigureAwait(false);
        }
Exemplo n.º 7
0
        protected virtual async Task DefineObservables(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await context.DefineObservableAsync <Uri, T>(Platform.Constants.Identifiers.Observable.FireHose.Uri, uri => new FirehoseSubscribable <T>(uri).AsQbservable(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <int>, int>(Platform.Constants.Identifiers.Observable.GarbageCollector.Uri, source => new GarbageCollectorObservable(source.To <IAsyncReactiveQbservable <int>, ISubscribable <int> >()).AsQbservable(), null, CancellationToken.None).ConfigureAwait(false);
        }
Exemplo n.º 8
0
        public void Execute(ReactiveClientContext context)
        {
            if (_doUndefine)
            {
                UndefineObservables(context).Wait();
                UndefineOperators(context).Wait();
                UndefineObservers(context).Wait();
            }

            DefineObservables(context).Wait();
            DefineOperators(context).Wait();
            DefineObservers(context).Wait();
        }
Exemplo n.º 9
0
        protected override async Task DefineObservers(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await base.DefineObservers(context).ConfigureAwait(false);

            await context.DefineObserverAsync <Uri, T>(
                Constants.Test.TestObserver.Uri,
                name => new TestObserver <T>(name).AsQbserver(),
                null,
                CancellationToken.None).ConfigureAwait(false);
        }
Exemplo n.º 10
0
        protected virtual async Task UndefineObservers(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.ConsoleObserver.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.ConsoleObserverParam.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.TraceObserver.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.TraceObserverParam.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.FireHose.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(Platform.Constants.Identifiers.Observer.Throughput.Uri, CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObserverAsync(new Uri(Client.Constants.Observer.Nop), CancellationToken.None)).ConfigureAwait(false);
        }
Exemplo n.º 11
0
        protected virtual async Task DefineObservers(ReactiveClientContext context)
        {
            var nopObserverFactory = (Expression <Func <IAsyncReactiveQbserver <T> > >)(() => NopObserver <T> .Instance.AsQbserver());
            var nopObserver        = context.Provider.CreateQbserver <T>(nopObserverFactory.Body);

            await context.DefineObserverAsync <HttpVerb, Uri, Tuple <string, string>[], SerializationProtocol, RetryData, T>(
                Reactor.Constants.Identifiers.Observer.Http.Uri,
                (method, endpoint, headers, protocol, retryData) =>
                new HttpObserver <T>(method, endpoint, headers, protocol, retryData).AsQbserver(),
                null,
                CancellationToken.None);

            await context.DefineObserverAsync <HttpData>(
                Reactor.Constants.Identifiers.Observer.Http.Action.Uri,
                context.GetObserver <string, HttpData>(Platform.Constants.Identifiers.Observer.ConsoleObserverParam.Uri)("DoHttp"),
                null,
                CancellationToken.None);

            await context.DefineObserverAsync <string, Uri, Uri, Tuple <string, string>[], RetryData, TimeSpan, T>(
                Reactor.Constants.Identifiers.Observer.Http.Final.Uri,
                (method, onCompleted, onError, headers, retryData, timeout) => nopObserver,
                null,
                CancellationToken.None);

            await context.DefineObserverAsync <HttpPost>(
                Reactor.Constants.Identifiers.Observer.HttpPost.Action.Uri,
                context.GetObserver <string, HttpPost>(Platform.Constants.Identifiers.Observer.ConsoleObserverParam.Uri)("DoHttpPost"),
                null,
                CancellationToken.None);

            await context.DefineObserverAsync <Uri, Uri, Tuple <string, string>[], T>(
                new Uri(Reactor.Constants.Identifiers.Observer.HttpPost.Final.WithHeaders),
                (onError, onCompleted, headers) => nopObserver,
                null,
                CancellationToken.None);

            await context.DefineObserverAsync <Uri, Uri, T>(
                new Uri(Reactor.Constants.Identifiers.Observer.HttpPost.Final.NoHeaders),
                (onError, onCompleted) => nopObserver,
                null,
                CancellationToken.None);
        }
Exemplo n.º 12
0
        public static IAsyncReactiveQbservable <Models.V2.WeatherAlert> CreateWeatherQbservable(ReactiveClientContext clientContext, long id, string firehoseUri)
        {
            string hoistedId = id.ToString();

            return
                (clientContext.GetObservable <Models.V2.WeatherAlert>(new Uri(firehoseUri))
                 .Where(weatherAlert => string.Equals(weatherAlert.Id, hoistedId))
                 .DistinctUntilChanged(t => string.Format(CultureInfo.InvariantCulture, "{0}:{1}", t.Title, t.StartTime)));
        }
Exemplo n.º 13
0
        public static IAsyncReactiveQbservable <TrafficNotification> CreateTrafficV2Qbservable(ReactiveClientContext clientContext)
        {
            var arrivalTime = DateTimeOffset.Now.AddHours(3);
            int notificationThresholdInSecs = 300;

            return(clientContext.GetObservable <TrafficInput, TrafficNotification>(
                       new Uri("bing://platform.bing.com/observable/real/trafficnotification"))(
                       new TrafficInput
            {
                NotificationThresholdInSeconds = notificationThresholdInSecs,
                ArrivalTime = arrivalTime,
                RouteWayPoints = new WayPoint[]
                {
                    new WayPoint {
                        Address = "Bellevue, WA"
                    },
                    new WayPoint {
                        Address = "Redmond, WA"
                    }
                }
            }));
        }
        public static async Task UndefineOperatorsExtension(ReactiveClientContext context)
        {
            #region Aggregates

            #region Average
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Average.Selector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);

            #endregion

            #region Min
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Min.Selector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);

            #endregion

            #region Max
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Max.Selector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);

            #endregion

            #region Sum
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.Int32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.Int64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.Single), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.Double), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.Decimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt32), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt64), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.NullableSingle), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.NullableDouble), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sum.Selector.NullableDecimal), CancellationToken.None)).ConfigureAwait(false);

            #endregion

            #endregion
        }
Exemplo n.º 15
0
        protected virtual async Task DefineOperators(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T, T> >, T>(new Uri(Client.Constants.Observable.Aggregate.Accumulate), (source, accumulate) => source.AsSync().Aggregate(accumulate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, R, Expression <Func <R, T, R> >, R>(new Uri(Client.Constants.Observable.Aggregate.Seed), (source, seed, accumulate) => source.AsSync().Aggregate(seed, accumulate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, T2, Expression <Func <T2, T1, T2> >, Expression <Func <T2, R> >, R>(new Uri(Client.Constants.Observable.Aggregate.SeedResult), (source, seed, accumulate, selector) => source.AsSync().Aggregate(seed, accumulate, selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, bool>(new Uri(Client.Constants.Observable.All.Predicate), (source, predicate) => source.AsSync().All(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.Any.NoArgument), source => source.AsSync().Any().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, bool>(new Uri(Client.Constants.Observable.Any.Predicate), (source, predicate) => source.AsSync().Any(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, Expression <Func <T1, T2, R> >, R>(new Uri(Client.Constants.Observable.CombineLatest.ObservableFunc), (source, otherSource, selector) => source.AsSync().CombineLatest(otherSource.AsSync(), selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int>(new Uri(Client.Constants.Observable.Count.NoArgument), source => source.AsSync().Count().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, int>(new Uri(Client.Constants.Observable.Count.Predicate), (source, predicate) => source.AsSync().Count(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.DelaySubscription.DateTimeOffset), (source, dueTime) => source.AsSync().DelaySubscription(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.DelaySubscription.TimeSpan), (source, dueTime) => source.AsSync().DelaySubscription(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.DelaySubscription.V1.DateTimeOffset), (source, dueTime) => ReactiveQbservable.Timer(dueTime).SelectMany(_ => source.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.DelaySubscription.V1.TimeSpan), (source, dueTime) => ReactiveQbservable.Timer(dueTime).SelectMany(_ => source.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.DistinctUntilChanged.NoArgument), source => source.AsSync().DistinctUntilChanged(DataTypeEqualityComparer <T> .Default).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, T>(new Uri(Client.Constants.Observable.DistinctUntilChanged.Func), (source, keySelector) => source.AsSync().DistinctUntilChanged(keySelector, DataTypeEqualityComparer <R> .Default).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, T>(new Uri(Client.Constants.Observable.Do.OnNext), (source, onNext) => source.AsSync().Do(onNext).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action <Exception> >, T>(new Uri(Client.Constants.Observable.Do.OnNextOnError), (source, onNext, onError) => source.AsSync().Do(onNext, onError).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action>, T>(new Uri(Client.Constants.Observable.Do.OnNextOnCompleted), (source, onNext, onCompleted) => source.AsSync().Do(onNext, onCompleted).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action <Exception> >, Expression <Action>, T>(new Uri(Client.Constants.Observable.Do.AllActions), (source, onNext, onError, onCompleted) => source.AsSync().Do(onNext, onError, onCompleted).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbserver <T>, T>(new Uri(Client.Constants.Observable.Do.Observer), (source, observer) => source.AsSync().Do(observer.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, IAsyncReactiveQbserver <R>, T>(new Uri(Client.Constants.Observable.Do.ObserverSelector), (source, selector, observer) => source.AsSync().Do(selector, observer.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action>, T>(new Uri(Client.Constants.Observable.Finally.Action), (source, action) => source.AsSync().Finally(action).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.FirstAsync.NoArgument), source => source.AsSync().FirstAsync().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.FirstAsync.Func), (source, predicate) => source.AsSync().FirstAsync(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.NoArgument), source => source.AsSync().FirstOrDefaultAsync().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.Func), (source, predicate) => source.AsSync().FirstOrDefaultAsync(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.IsEmpty.NoArgument), source => source.AsSync().IsEmpty().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, long>(new Uri(Client.Constants.Observable.LongCount.NoArgument), source => source.AsSync().LongCount().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, long>(new Uri(Client.Constants.Observable.LongCount.Predicate), (source, predicate) => source.AsSync().LongCount(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.Retry.NoArgument), source => source.AsSync().Retry().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Retry.Count), (source, retryCount) => source.AsSync().Retry(retryCount).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <T, T>(new Uri(Client.Constants.Observable.Return.Value), value => ReactiveQbservable.Return(value).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Sample.TimeSpan), (source, interval) => source.AsSync().Sample(interval).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <R>, T>(new Uri(Client.Constants.Observable.Sample.Observable), (source, sampler) => source.AsSync().Sample(sampler.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T, T> >, T>(new Uri(Client.Constants.Observable.Scan.Accumulate), (source, aggregate) => source.AsSync().Scan(aggregate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, R, Expression <Func <R, T, R> >, R>(new Uri(Client.Constants.Observable.Scan.Seed), (source, seed, aggregate) => source.AsSync().Scan(seed, aggregate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, R>(new Uri(Client.Constants.Observable.Select.Func), (source, selector) => source.AsSync().Select(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, R> >, R>(new Uri(Client.Constants.Observable.Select.IndexedFunc), (source, selector) => source.AsSync().Select(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.SequenceEqual.NoArgument), (left, right) => left.AsSync().SequenceEqual(right.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Skip.Count), (source, count) => source.AsSync().Skip(count).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Skip.TimeSpan), (source, dueTime) => source.AsSync().Skip(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.SkipUntil.DateTimeOffset), (source, dueTime) => source.AsSync().SkipUntil(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, T1>(new Uri(Client.Constants.Observable.SkipUntil.Observable), (source, triggeringSource) => source.AsSync().SkipUntil(triggeringSource.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.SkipWhile.Func), (source, predicate) => source.AsSync().SkipWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.SkipWhile.IndexedFunc), (source, predicate) => source.AsSync().SkipWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T[], T>(new Uri(Client.Constants.Observable.StartWith.Array), (source, values) => source.AsSync().StartWith(values).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Take.Count), (source, count) => source.AsSync().Take(count).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Take.TimeSpan), (source, duration) => source.AsSync().Take(duration).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.TakeUntil.DateTimeOffset), (source, startTime) => source.AsSync().TakeUntil(startTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, T1>(new Uri(Client.Constants.Observable.TakeUntil.Observable), (source, other) => source.AsSync().TakeUntil(other.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.TakeWhile.Func), (source, predicate) => source.AsSync().TakeWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.TakeWhile.IndexedFunc), (source, predicate) => source.AsSync().TakeWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <DateTimeOffset, long>(new Uri(Client.Constants.Observable.Timer.DateTimeOffset), dueTime => ReactiveQbservable.Timer(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <DateTimeOffset, TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.DateTimeOffsetTimeSpan), (dueTime, period) => ReactiveQbservable.Timer(dueTime, period).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.TimeSpan), dueTime => ReactiveQbservable.Timer(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <TimeSpan, TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.TimeSpanTimeSpan), (dueTime, period) => ReactiveQbservable.Timer(dueTime, period).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IList <T> >(new Uri(Client.Constants.Observable.ToList.NoArgument), source => source.AsSync().ToList().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.Where.Func), (source, predicate) => source.AsSync().Where(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.Where.IndexedFunc), (source, predicate) => source.AsSync().Where(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.Merge.Binary), (left, right) => left.To <IAsyncReactiveQbservable <T>, IReactiveQbservable <T> >().Merge(right.To <IAsyncReactiveQbservable <T>, IReactiveQbservable <T> >()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>[], T>(new Uri(Client.Constants.Observable.Merge.N), sources => ReactiveQbservable.Merge(sources.To <IAsyncReactiveQbservable <T>[], IReactiveQbservable <T>[]>()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            // Non-parameterized defines
            var emptyFactory    = (Expression <Func <IAsyncReactiveQbservable <T> > >)(() => ReactiveQbservable.Empty <T>().AsAsync());
            var emptyObservable = context.Provider.CreateQbservable <T>(emptyFactory.Body);
            await context.DefineObservableAsync <T>(new Uri(Client.Constants.Observable.Empty.NoArgument), emptyObservable, null, CancellationToken.None).ConfigureAwait(false);

            var neverFactory    = (Expression <Func <IAsyncReactiveQbservable <T> > >)(() => ReactiveQbservable.Never <T>().AsAsync());
            var neverObservable = context.Provider.CreateQbservable <T>(neverFactory.Body);
            await context.DefineObservableAsync <T>(new Uri(Client.Constants.Observable.Never.NoArgument), neverObservable, null, CancellationToken.None).ConfigureAwait(false);

            // Higher order defines
            await context.DefineObservableAsync <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, T>(new Uri(Client.Constants.Observable.Merge.NoArgument), source => source.To <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, IReactiveQbservable <IReactiveObservable <T> > >().Merge().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, T>(new Uri(Client.Constants.Observable.Switch.NoArgument), source => source.To <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, IReactiveQbservable <IReactiveObservable <T> > >().Switch().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Throttle.TimeSpan), (source, dueTime) => source.AsSync().Throttle(_ => ReactiveQbservable.Timer(dueTime)).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, IAsyncReactiveQbservable <R> > >, R>(
                new Uri(Client.Constants.Observable.SelectMany.Func),
                (source, selector) => source.AsSync().SelectMany(selector.To <Expression <Func <T, IAsyncReactiveQbservable <R> > >, Expression <Func <T, IReactiveQbservable <R> > > >()).AsAsync(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, Expression <Func <T1, IAsyncReactiveQbservable <T2> > >, Expression <Func <T1, T2, R> >, R>(
                new Uri(Client.Constants.Observable.SelectMany.FuncFunc),
                (source, collectionSelector, resultSelector) => source.AsSync().SelectMany(collectionSelector.To <Expression <Func <T1, IAsyncReactiveQbservable <T2> > >, Expression <Func <T1, IReactiveQbservable <T2> > > >(), resultSelector).AsAsync(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeDuration), (source, duration) => source.AsSync().Window(duration).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, TimeSpan, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeDurationShift), (source, duration, shift) => source.AsSync().Window(duration, shift).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.Count), (source, count) => source.AsSync().Window(count).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.CountSkip), (source, count, skip) => source.AsSync().Window(count, skip).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeCount), (source, duration, count) => source.AsSync().Window(duration, count).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeDuration), (source, duration) => source.AsSync().Buffer(duration).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, TimeSpan, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeDurationShift), (source, duration, shift) => source.AsSync().Buffer(duration, shift).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.Count), (source, count) => source.AsSync().Buffer(count).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.CountSkip), (source, count, skip) => source.AsSync().Buffer(count, skip).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeCount), (source, duration, count) => source.AsSync().Buffer(duration, count).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T1> >, IAsyncReactiveGroupedQbservable <T1, T> >(new Uri(Client.Constants.Observable.GroupBy.Key), (source, keySelector) => source.AsSync().GroupBy(keySelector).To <IReactiveQbservable <IReactiveGroupedQbservable <T1, T> >, IAsyncReactiveQbservable <IAsyncReactiveGroupedQbservable <T1, T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T1> >, Expression <Func <T, T2> >, IAsyncReactiveGroupedQbservable <T1, T2> >(new Uri(Client.Constants.Observable.GroupBy.KeyElement), (source, keySelector, elementSelector) => source.AsSync().GroupBy(keySelector, elementSelector).To <IReactiveQbservable <IReactiveGroupedQbservable <T1, T2> >, IAsyncReactiveQbservable <IAsyncReactiveGroupedQbservable <T1, T2> > >(), null, CancellationToken.None).ConfigureAwait(false);

            // Extension defines
            await DefineOperatorsExtension(context).ConfigureAwait(false);
        }
Exemplo n.º 16
0
 public static IAsyncReactiveQbservable <Models.V2.WeatherAlert> CreateRawWeatherQbservable(ReactiveClientContext clientContext, string firehoseUri)
 {
     return(clientContext.GetObservable <Models.V2.WeatherAlert>(new Uri(firehoseUri)));
 }
        public static async Task DefineOperatorsExtension(ReactiveClientContext context)
        {
            #region Aggregates

            #region Average
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Int32), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Int32), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Int64), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Int64), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Average.NoSelector.Single), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Average.Selector.Single), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Double), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Double), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Average.NoSelector.Decimal), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Average.Selector.Decimal), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt32), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableInt32), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt64), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableInt64), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableSingle), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Average.Selector.NullableSingle), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDouble), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableDouble), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDecimal), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Average.Selector.NullableDecimal), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Min
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Min.NoSelector.Int32), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Min.Selector.Int32), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Min.NoSelector.Int64), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Min.Selector.Int64), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Min.NoSelector.Single), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Min.Selector.Single), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Min.NoSelector.Double), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Min.Selector.Double), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Min.NoSelector.Decimal), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Min.Selector.Decimal), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt32), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Min.Selector.NullableInt32), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt64), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Min.Selector.NullableInt64), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableSingle), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Min.Selector.NullableSingle), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDouble), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Min.Selector.NullableDouble), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDecimal), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Min.Selector.NullableDecimal), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Max
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Max.NoSelector.Int32), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Max.Selector.Int32), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Max.NoSelector.Int64), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Max.Selector.Int64), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Max.NoSelector.Single), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Max.Selector.Single), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Max.NoSelector.Double), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Max.Selector.Double), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Max.NoSelector.Decimal), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Max.Selector.Decimal), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt32), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Max.Selector.NullableInt32), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt64), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Max.Selector.NullableInt64), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableSingle), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Max.Selector.NullableSingle), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDouble), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Max.Selector.NullableDouble), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDecimal), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Max.Selector.NullableDecimal), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Sum
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Sum.NoSelector.Int32), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Sum.Selector.Int32), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Sum.NoSelector.Int64), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Sum.Selector.Int64), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Sum.NoSelector.Single), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Sum.Selector.Single), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Sum.NoSelector.Double), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Sum.Selector.Double), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Sum.NoSelector.Decimal), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Sum.Selector.Decimal), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt32), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt32), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt64), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt64), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableSingle), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableSingle), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDouble), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableDouble), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDecimal), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableDecimal), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #endregion
        }
Exemplo n.º 18
0
 protected virtual async Task UndefineObservables(ReactiveClientContext context)
 {
     await TryUndefine(() => context.UndefineObservableAsync(Constants.Identifiers.Observable.Person.Uri, CancellationToken.None));
     await TryUndefine(() => context.UndefineObservableAsync(Constants.Identifiers.Observable.Range.Uri, CancellationToken.None));
 }
Exemplo n.º 19
0
 protected override Task UndefineObservers(ReactiveClientContext context)
 {
     return(Task.FromResult(true));
 }
Exemplo n.º 20
0
 protected virtual async Task RedefineObservers(ReactiveClientContext context)
 {
     await UndefineObservers(context);
     await DefineObservers(context);
 }
Exemplo n.º 21
0
 private async Task RedefineObservables(ReactiveClientContext context)
 {
     await UndefineObservables(context);
     await DefineObservables(context);
 }
Exemplo n.º 22
0
        protected virtual async Task DefineObservables(ReactiveClientContext context)
        {
            await context.DefineObservableAsync <PersonObservableParameters, Person>(Constants.Identifiers.Observable.Person.Uri, parameters => new PersonObservable(parameters).AsQbservable(), null, CancellationToken.None);

            await context.DefineObservableAsync <int, int>(Constants.Identifiers.Observable.Range.Uri, count => new RangeObservable(count).AsQbservable(), null, CancellationToken.None);
        }
Exemplo n.º 23
0
        public static IAsyncReactiveQbservable <Models.V2.FlightInfo> CreateFlightsQbservable(ReactiveClientContext clientContext, long id, string firehoseUri)
        {
            // skip until and take until to keep the query running for a long time
            var skipUntil = DateTimeOffset.Now.AddMinutes(1);
            var takeUntil = DateTimeOffset.Now.AddDays(7);

            string hoistedId = id.ToString();

            return
                (clientContext.GetObservable
                 <Models.V2.FlightInfo>(
                     new Uri(firehoseUri))
                 .Where(flightInfo => string.Equals(flightInfo.FlightNumber, hoistedId))
                 .Select(t => t)
                 .DistinctUntilChanged(t => t.DateTimeRecorded)
                 .SkipUntil(skipUntil)
                 .TakeUntil(takeUntil)
                 .Take(FlightsSubscriptionTakeCount));
        }
Exemplo n.º 24
0
 public static IAsyncReactiveQbservable <Models.V2.FlightInfo> CreateRawFlightsQbservable(ReactiveClientContext clientContext, string firehoseUri)
 {
     return(clientContext.GetObservable <Models.V2.FlightInfo>(new Uri(firehoseUri)));
 }
Exemplo n.º 25
0
 public static IAsyncReactiveQbservable <CasiEvent> CreateRawCasiQbservable(ReactiveClientContext clientContext, string firehoseUri)
 {
     return(clientContext.GetObservable <CasiEvent>(new Uri(firehoseUri)));
 }
Exemplo n.º 26
0
        public static IAsyncReactiveQbservable <TrafficInfo> CreateTrafficQbservable(ReactiveClientContext clientContext)
        {
            var tarnEndpoint        = "bing://platform.bing.com/tarn/";
            var startMonitoring     = DateTimeOffset.Now.AddMinutes(TrafficSubscriptionStartListeningAfterInMinutes);
            var stopMonitoring      = DateTimeOffset.Now.AddMinutes(TrafficSubscriptionStopMonitoringAfterInMinutes);
            var noTrafficNotifyTime = stopMonitoring.AddMinutes(-15);

            int      notificationThresholdInSecs   = 300;
            int      renotificationThresholdInSecs = 300;
            TimeSpan extraBuffer = TimeSpan.FromMinutes(2);

            TimeSpan travelTimeWithoutTraffic     = TimeSpan.FromSeconds(700);
            TimeSpan initialTravelTimeWithTraffic = TimeSpan.FromSeconds(800);

            return(clientContext.GetObservable <TrafficParameters, TrafficConfiguration, TrafficInfo>(
                       new Uri("bing://platform.bing.com/observable/real/trafficinfo/generic"))(
                       new TrafficParameters {
                RouteId = "bla"
            }, new TrafficConfiguration {
                ServiceEndpoint = tarnEndpoint
            })
                   .DelaySubscription(startMonitoring)
                   .TakeUntil(stopMonitoring)
                   .Where(traffic => traffic.NotificationType == NotificationTypeEnum.Flow)
                   .Select(traffic =>
                           clientContext.Timer(
                               // the right time to fire is the different between UTC now and the right
                               // time to leave for the event. The right time to leave is the UTC event
                               // start time minus the travel duration without traffic, minus the traffic
                               // minus a configurable extra buffer
                               startMonitoring
                               - TimeSpan.FromSeconds(traffic.FlowInfo.FreeFlowTravelDurationInSeconds)
                               - TimeSpan.FromSeconds(traffic.FlowInfo.DelayInSeconds)
                               - TimeSpan.FromSeconds(notificationThresholdInSecs)
                               - extraBuffer)
                           .Select(_ => traffic))
                   .StartWith(clientContext.Timer(noTrafficNotifyTime).Select(_ => new TrafficInfo()
            {
                FlowInfo = new TrafficFlowInfo()
                {
                    DelayInSeconds = 0,
                    FreeFlowTravelDurationInSeconds = (int)travelTimeWithoutTraffic.TotalSeconds,
                    HovDelayInSeconds = 0,
                },
                NotificationType = NotificationTypeEnum.Flow,
                Subscription = new TrafficParameters()
                {
                    StartAddress = "startBla",
                    EndAddress = "endBla",
                    StartTime = startMonitoring,
                    EndTime = stopMonitoring,
                    FlowParameters = new TrafficFlowParameters()
                    {
                        NotificationThresholdInSeconds = notificationThresholdInSecs,
                        RenotificationThresholdInSeconds = renotificationThresholdInSecs
                    }
                },
                SubscriptionId = "NoTrafficEventsSubscriptionId",
                TimestampUTC = DateTime.UtcNow
            }))
                   .Switch()
                   .Take(TrafficSubscriptionTakeCount));
        }
Exemplo n.º 27
0
        protected virtual async Task UndefineOperators(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Aggregate.Accumulate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Aggregate.Seed), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Aggregate.SeedResult), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.All.Predicate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Any.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Any.Predicate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Buffer.TimeDuration), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Buffer.TimeDurationShift), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Buffer.Count), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Buffer.CountSkip), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Buffer.TimeCount), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.CombineLatest.ObservableFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Count.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Count.Predicate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DelaySubscription.DateTimeOffset), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DelaySubscription.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DelaySubscription.V1.DateTimeOffset), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DelaySubscription.V1.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DistinctUntilChanged.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.DistinctUntilChanged.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.OnNext), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.OnNextOnError), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.OnNextOnCompleted), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.AllActions), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.Observer), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Do.ObserverSelector), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Empty.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Finally.Action), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.FirstAsync.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.FirstAsync.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.GroupBy.Key), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.GroupBy.KeyElement), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.IsEmpty.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.LongCount.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.LongCount.Predicate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Merge.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Merge.Binary), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Merge.N), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Never.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Return.Value), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Retry.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Retry.Count), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sample.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Sample.Observable), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Scan.Accumulate), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Scan.Seed), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Select.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Select.IndexedFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SelectMany.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SelectMany.FuncFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SequenceEqual.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Skip.Count), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Skip.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SkipUntil.DateTimeOffset), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SkipUntil.Observable), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SkipWhile.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.SkipWhile.IndexedFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.StartWith.Array), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Switch.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Take.Count), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Take.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.TakeUntil.DateTimeOffset), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.TakeUntil.Observable), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.TakeWhile.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.TakeWhile.IndexedFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Throttle.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Timer.DateTimeOffset), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Timer.DateTimeOffsetTimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Timer.TimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Timer.TimeSpanTimeSpan), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.ToList.NoArgument), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Where.Func), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Where.IndexedFunc), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Window.TimeDuration), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Window.TimeDurationShift), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Window.Count), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Window.CountSkip), CancellationToken.None)).ConfigureAwait(false);
            await TryUndefine(() => context.UndefineObservableAsync(new Uri(Client.Constants.Observable.Window.TimeCount), CancellationToken.None)).ConfigureAwait(false);

            await UndefineOperatorsExtension(context).ConfigureAwait(false);
        }
Exemplo n.º 28
0
 public void Execute(ReactiveClientContext context)
 {
     RedefineObservables(context).Wait();
     RedefineObservers(context).Wait();
 }