Ejemplo n.º 1
0
        DebugCounters ICountersDb.NewCounters()
        {
            var counters = new DebugCounters(this);

            lock (_mutex)
            {
                _all.Add(counters);
            }

            return counters;
        }
Ejemplo n.º 2
0
        public ResolvingThread(Self self, IManager engine)
        {
            _helloMsgGap = self.config.HelloMessageGap;
            _engine = engine;

            _todos = new BlockingCollection<Action>();
            _isStoppedEvent = new ManualResetEvent(false);

            _thr = new Thread(discovery_update_main)
                       {
                           Name = "l4p.VcallModel.ResolvingThread"
                       };

            _stopFlagIsOn = false;
            _groovyTimer = new Stopwatch();

            _counters = Context.Get<ICountersDb>().NewCounters();
        }
Ejemplo n.º 3
0
        DebugCounters ICountersDb.SumAll()
        {
            DebugCounters[] all;

            lock (_mutex)
            {
                all = _all.ToArray();
            }

            var sum = new DebugCounters(this);

            foreach (var counters in all)
            {
                sum.Accumulate(counters);
            }

            return sum;
        }
Ejemplo n.º 4
0
        public WcfDiscovery(Self self, IManager engine)
        {
            _self = self;
            _engine = engine;

            var listener = new AnnouncementService();

            listener.OnlineAnnouncementReceived +=
                (sender, args) => handle_hello_message(args.EndpointDiscoveryMetadata);

            _mutex = new Object();
            _serviceEndpoint = new UdpAnnouncementEndpoint();
            _announcementService = new ServiceHost(listener);
            _announcementService.AddServiceEndpoint(_serviceEndpoint);

            _announcementCleint = new AnnouncementClient(new UdpAnnouncementEndpoint());

            _counters = Context.Get<ICountersDb>().NewCounters();
        }
Ejemplo n.º 5
0
 public Manager(Self self)
 {
     _self = self;
     _counters = Context.Get<ICountersDb>().NewCounters();
 }
Ejemplo n.º 6
0
 private DurableQueue()
 {
     _ops = new LinkedList<IDurableOperation>();
     _counters = Context.Get<ICountersDb>().NewCounters();
 }
Ejemplo n.º 7
0
        private ActiveThread(Config config)
        {
            _config = config;
            _RunInContextOf = config.RunInContextOf;

            _que = ActionQueue.New();
            _durables = DurableQueue.New();
            _isStartedEvent = new ManualResetEvent(false);
            _isStoppedEvent = new ManualResetEvent(false);

            _thr = new Thread(main) { Name = _config.Name };

            _counters = Context.Get<ICountersDb>().NewCounters();

            _stopFlagIsOn = false;
        }
Ejemplo n.º 8
0
 private Repository()
 {
     _hostings = new Dictionary<string, HostingInfo>();
     _counters = Context.Get<ICountersDb>().NewCounters();
 }
Ejemplo n.º 9
0
 private Repository()
 {
     _counters = Context.Get<ICountersDb>().NewCounters();
     _peers = new List<ICommPeer>();
 }
Ejemplo n.º 10
0
 protected CommPeer()
 {
     _tag = Helpers.GetRandomName();
     _counters = Context.Get<ICountersDb>().NewCounters();
     _state = State.None;
 }
Ejemplo n.º 11
0
 private Repository()
 {
     _proxies = new Dictionary<string, ProxyInfo>();
     _counters = Context.Get<ICountersDb>().NewCounters();
 }
Ejemplo n.º 12
0
 public Repository()
 {
     _publishers = new List<Publisher>();
     _subscribers = new List<Subscriber>();
     _peers = new Dictionary<string, RemotePeer>();
     _counters = Context.Get<ICountersDb>().NewCounters();
 }
Ejemplo n.º 13
0
        public static void Accumulate(this DebugCounters lhsCounters, DebugCounters rhsCounters)
        {
            foreach (var field in _counterFields)
            {
                int lhs = (int) field.GetValue(lhsCounters, null);
                int rhs = (int) field.GetValue(rhsCounters, null);

                field.SetValue(lhsCounters, lhs + rhs, null);
            }
        }