コード例 #1
0
 public void OnNext(DiagnosticListener value)
 {
     if ((Interlocked.Read(ref this.disposed) == 0) &&
         this.listenerSubscription == null &&
         this.handler.SourceName == value.Name)
     {
         var listener = new DiagnosticSourceListener(this.handler);
         this.listenerSubscription = this.filter == null?
                                     value.Subscribe(listener) :
                                         value.Subscribe(listener, this.filter);
     }
 }
 public void OnNext(DiagnosticListener value)
 {
     if ((Interlocked.Read(ref this.disposed) == 0) && this.subscriptions != null)
     {
         if (this.handlers.ContainsKey(value.Name))
         {
             this.subscriptions.GetOrAdd(value.Name, name =>
             {
                 var dl          = new DiagnosticSourceListener <TInput>(this.handlers[value.Name](this.tracer, this.sampler));
                 dl.Subscription = value.Subscribe(dl);
                 return(dl);
             });
         }
     }
 }
コード例 #3
0
        public void OnNext(DiagnosticListener value)
        {
            if ((Interlocked.Read(ref this.disposed) == 0) &&
                this.diagnosticSourceFilter(value))
            {
                var listener     = new DiagnosticSourceListener(this.handler);
                var subscription = this.filter == null?
                                   value.Subscribe(listener) :
                                       value.Subscribe(listener, this.filter);

                lock (this.listenerSubscriptions)
                {
                    this.listenerSubscriptions.Add(subscription);
                }
            }
        }