示例#1
0
        public void Run(object o)
        {
            while (true)
            {
                if (!_nodeInfo.HaveAcessRight)
                {
                    break;
                }

                if (!PureCat.IsInitialized())
                {
                    Thread.Sleep(5000);
                    continue;
                }

                PureCat.DoTransaction("System", "Status", () =>
                {
                    _nodeInfo.Refresh();
                    PureCat.LogHeartbeat("Heartbeat", AppEnv.IP, PureCatConstants.SUCCESS, XmlHelper.XmlSerialize(_nodeInfo, Encoding.UTF8));
                    PureCat.LogEvent("System", $"Cat.Version : {PureCat.Version}", PureCatConstants.SUCCESS, PureCat.Version);
                });

                Thread.Sleep(60000);
            }
        }
示例#2
0
        static CatContext DoTest()
        {
            var times = _rand.Next(1000);

            Thread.Sleep(times);
            PureCat.LogEvent("Do", nameof(DoTest), "0", $"sleep {times}");
            return(PureCat.LogRemoteCallClient("callAdd"));
        }
示例#3
0
 static void Add(int a, int b, CatContext context = null)
 {
     PureCat.LogRemoteCallServer(context);
     PureCat.LogEvent("Do", nameof(Add), "0", $"{a} + {b} = {a + b}");
 }