Пример #1
0
 public CommitSequencer(Func <ICommit, PollingClient2.HandlingResult> commitCallback, long lastCommitRead, int outOfSequenceTimeoutInMilliseconds)
 {
     _logger         = LogFactory.BuildLogger(GetType());
     _commitCallback = commitCallback;
     _lastCommitRead = lastCommitRead;
     _outOfSequenceTimeoutInMilliseconds = outOfSequenceTimeoutInMilliseconds;
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="persistStreams"></param>
        /// <param name="callback"></param>
        /// <param name="waitInterval">Interval in Milliseconds to wait when the provider
        /// return no more commit and the next request</param>
        public PollingClient2(IPersistStreams persistStreams, Func <ICommit, HandlingResult> callback, Int32 waitInterval = 100)
        {
            if (persistStreams == null)
            {
                throw new ArgumentNullException("PersistStreams cannot be null", "persistStreams");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("Cannot use polling client without callback", "callback");
            }

            _logger                      = LogFactory.BuildLogger(GetType());
            _waitInterval                = waitInterval;
            _pollingWakeUpTimer          = new System.Timers.Timer();
            _pollingWakeUpTimer.Elapsed += (sender, e) => WakeUpPoller();
            _pollingWakeUpTimer.Interval = _waitInterval;

            //Create polling thread
            _pollingThread = new Thread(InnerPollingLoop);
            _pollingThread.Start();

            _commitCallback        = callback;
            _persistStreams        = persistStreams;
            _lastActivityTimestamp = DateTime.UtcNow;
        }
        private static void IntialSetup()
        {
            LogFactory.BuildLogger = type => new ConsoleWindowLogger(type);
            logger = LogFactory.BuildLogger(typeof(Program));
            Console.WindowHeight = 40;
            Console.WindowWidth  = 120;

            PrintHelp();
        }
 public InMemoryRepository(InMemoryDataStore dataStore)
 {
     logger               = LogFactory.BuildLogger(GetType());
     this.dataStore       = dataStore;
     identityPropertyInfo = GetIdentityPropertyInformation();
 }
Пример #5
0
 protected SerializerBase()
 {
     this.log = LogFactory.BuildLogger(this.GetType());
 }