コード例 #1
0
        private async Task UnsubscribeFromAttribute(DataSubscription subscription)
        {
            var series      = GrainClient.GrainFactory.GetGrain <IAttributeSeriesGrain>(SeriesIdHelper.ToCalculationSeriesId(subscription.Entity, subscription.Attribute));
            var observerRef = await GrainClient.GrainFactory.CreateObjectReference <ISeriesObserver>(subscription.Observer);

            await series.Unsubscribe(observerRef);
        }
コード例 #2
0
        private async Task <DataSubscription> SubscribeToAttribute(string socketId, DataSubscription subscription)
        {
            var series = GrainClient.GrainFactory.GetGrain <IAttributeSeriesGrain>(SeriesIdHelper.ToAttributeSeriesId(subscription.Entity, subscription.Attribute));

            subscription.Observer = new SeriesObserver(socketId, this);
            var observerRef = await GrainClient.GrainFactory.CreateObjectReference <ISeriesObserver>(subscription.Observer);

            await series.Subscribe(observerRef);

            return(subscription);
        }
コード例 #3
0
        public override bool Equals(object obj)
        {
            DataSubscription subscription = obj as DataSubscription;

            return(subscription != null && subscription.Entity == Entity && subscription.Attribute == Attribute);
        }