Example #1
0
        private void ApplyProc()
        {
            var wh = new WaitHandle[] { _evExit, _evGotNotification };

            while (true)
            {
                IRepositoryChangedNotification notification = null;
                lock (_pendingNotifications)
                {
                    if (_pendingNotifications.Count != 0)
                    {
                        notification = _pendingNotifications.Dequeue();
                    }
                }
                if (notification == null)
                {
                    if (WaitHandle.WaitAny(wh) == 0)
                    {
                        return;
                    }
                    continue;
                }
                try
                {
                    notification.Apply(_repository);
                }
                catch
                {
                }
            }
        }
Example #2
0
 private void EmitDelayedNotification(IRepositoryChangedNotification notification)
 {
     lock (_delayedNotifications)
     {
         _delayedNotifications.Enqueue(notification);
     }
     _evGotDelayedNotification.Set();
 }
Example #3
0
 private void EmitNotification(IRepositoryChangedNotification notification)
 {
     lock (_pendingNotifications)
     {
         _pendingNotifications.Enqueue(notification);
     }
     _evGotNotification.Set();
 }
Example #4
0
 private void EmitNotification(IRepositoryChangedNotification notification)
 {
     lock(_pendingNotifications)
     {
         _pendingNotifications.Enqueue(notification);
     }
     _evGotNotification.Set();
 }
Example #5
0
 private void EmitDelayedNotification(IRepositoryChangedNotification notification)
 {
     lock(_delayedNotifications)
     {
         _delayedNotifications.Enqueue(notification);
     }
     _evGotDelayedNotification.Set();
 }