public ObservableInfo CreateObservable(int instrumentationPoint)
        {
            var obs = new ObservableInfo(instrumentationPoint);

            mEventMediator.ObservableCreated(obs);
            return(obs);
        }
 public void ObservableCreated(ObservableInfo rootObs)
 {
     if (mIsMonitoringAll || mMonitoredInstrumentationPoints.ContainsKey(rootObs.InstrumentationPoint))
     {
         MonitorChain(rootObs);
     }
 }
 public void RemoveInput(ObservableInfo info)
 {
     if (mInputs.TryRemove(info, out _))
     {
         Services.Store.NotifyObservablesUnlinked(this, info);
     }
 }
 public void AddInput(ObservableInfo info)
 {
     if (mInputs.TryAdd(info, true))
     {
         Services.Store.NotifyObservablesLinked(this, info);
     }
 }
 public void ObservablesLinked(ObservableInfo output, ObservableInfo input)
 {
     if (output.Monitoring)
     {
         mEventSink?.ObservablesLinked(output, input);
         MonitorChain(input);
     }
 }
Example #6
0
        public SubscriptionInfo CreateSub(ObservableInfo observable)
        {
            var sub = new SubscriptionInfo(observable);

            mActiveSubscriptions.TryAdd(sub.SubscriptionId, sub);
            GetInstrumentationPointSubscriptions(observable.InstrumentationPoint).AddSub(sub);
            observable.ActiveSubscriptions.TryAdd(sub.SubscriptionId, sub);

            EventSink.Subscribed(sub);

            if (TraceEvents)
            {
                System.Diagnostics.Trace.WriteLine($"Obs{observable.ObservableId}:Sub{sub.SubscriptionId}:Subscribe");
            }

            return(sub);
        }
            private void MonitorChain(ObservableInfo obs)
            {
                if (obs.Monitoring)
                {
                    return;
                }

                obs.Monitoring = true;

                mEventSink?.ObservableCreated(obs);

                foreach (var sub in Subscriptions.GetSubs(obs))
                {
                    Subscribed(sub);
                }

                foreach (var input in obs.Inputs)
                {
                    MonitorChain(input);
                }
            }
 public SubscriptionInfo(ObservableInfo observable)
 {
     Details    = CommonEventDetails.Capture();
     Observable = observable;
 }
Example #9
0
 public IEnumerable <SubscriptionInfo> GetSubs(ObservableInfo obs)
 {
     return(obs.ActiveSubscriptions.Values);
 }
 public void NotifyObservablesUnlinked(ObservableInfo output, ObservableInfo input)
 {
     // No need to do anything?
 }
 public void NotifyObservablesLinked(ObservableInfo output, ObservableInfo input)
 {
     mEventMediator.ObservablesLinked(output, input);
 }
 private void UnmonitorChain(ObservableInfo observable)
 {
     // TODO
 }
 public void StopMonitoringAll()
 {
     mIsMonitoringAll = false;
     mMonitoredInstrumentationPoints.Clear();
     ObservableInfo.StopMonitoringAll();
 }