Exemplo n.º 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
                {
                }
            }
        }
Exemplo n.º 2
0
 private void EmitDelayedNotification(IRepositoryChangedNotification notification)
 {
     lock (_delayedNotifications)
     {
         _delayedNotifications.Enqueue(notification);
     }
     _evGotDelayedNotification.Set();
 }
Exemplo n.º 3
0
 private void EmitNotification(IRepositoryChangedNotification notification)
 {
     lock (_pendingNotifications)
     {
         _pendingNotifications.Enqueue(notification);
     }
     _evGotNotification.Set();
 }
Exemplo n.º 4
0
 private void EmitNotification(IRepositoryChangedNotification notification)
 {
     lock(_pendingNotifications)
     {
         _pendingNotifications.Enqueue(notification);
     }
     _evGotNotification.Set();
 }
Exemplo n.º 5
0
 private void EmitDelayedNotification(IRepositoryChangedNotification notification)
 {
     lock(_delayedNotifications)
     {
         _delayedNotifications.Enqueue(notification);
     }
     _evGotDelayedNotification.Set();
 }