Beispiel #1
0
 protected override void OnFirstCallback()
 {
     // subscribe to import rules
     _ruleCache = IntClient.Target.CreateCache(delegate(CacheChangeData update)
     {
         Interlocked.Increment(ref _dispatchedEventCount);
         MainThreadQueue.Dispatch(update, ProcessRuleUpdate);
     }, null);
     _ruleCache.Subscribe <AlertRule>(
         RuleObject.MakeRuleFilter(
             EnvHelper.EnvName(IntClient.Target.ClientInfo.ConfigEnv),
             IntClient.Target.ClientInfo.HostName,
             AppName,
             IntClient.Target.ClientInfo.UserName));
     // start a 30 second timer to periodically check the rules
     _timer = new Timer(RecvTimerEvent, null, TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30));
 }
        protected override void OnFirstCallback()
        {
            // subscribe to import rules
            _importRuleSet = IntClient.Target.CreateCache(delegate(CacheChangeData update)
            {
                Interlocked.Increment(ref _updateRequestsDispatched);
                MainThreadQueue.Dispatch(update, ProcessRuleUpdate);
            }, null);
            _importRuleSet.Subscribe <FileImportRule>(
                RuleObject.MakeRuleFilter(
                    EnvHelper.EnvName(IntClient.Target.ClientInfo.ConfigEnv),
                    IntClient.Target.ClientInfo.HostName,
                    AppName,
                    IntClient.Target.ClientInfo.UserName));

            // start a 1 minute timer to periodically check the rules
            _timer = new Timer(RecvTimerEvent, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1));
        }