コード例 #1
0
ファイル: MessageManager.cs プロジェクト: nonomal/NCache
        public void StartMessageProcessing()
        {
            _store = _context.CacheImpl;
            _cacheEventListener = _context.CacheImpl as ICacheEventsListener;

            _store.RegiserTopicEventListener(this);

            if (_assignmentThread == null)
            {
                _assignmentThread = new Thread(new ThreadStart(ProcessMessage));
                _assignmentThread.IsBackground = true;
                _assignmentThread.Name         = "Messaging.MessageProcessor";
                _assignmentThread.Start();
            }

            if (_notificationThread == null)
            {
                _notificationThread = new Thread(new ThreadStart(NotifyClients));
                _notificationThread.IsBackground = true;
                _notificationThread.Name         = "Messaging.Notification";
                _notificationThread.Start();
            }

            if (_taskExpiry == null)
            {
                _taskExpiry = new AutoExpirationTask(this, _cleanInterval);
                _context.TimeSched.AddTask(_taskExpiry);
            }
        }
コード例 #2
0
 /// <summary>
 /// Start the auto-expiration task
 /// </summary>
 public void Start()
 {
     if (_taskExpiry == null)
     {
         _taskExpiry = new AutoExpirationTask(this, _cleanInterval);
         _context.TimeSched.AddTask(_taskExpiry);
     }
 }
コード例 #3
0
 /// <summary>
 /// Libera a instancia.
 /// </summary>
 public virtual void Dispose()
 {
     if (_taskExpiry != null)
     {
         _taskExpiry.Cancel();
         _taskExpiry = null;
     }
     lock (_status_mutex)
     {
         _mainIndex.Clear();
         _mainIndex = null;
         _transitoryIndex.Clear();
         _transitoryIndex = null;
     }
     GC.SuppressFinalize(this);
 }
コード例 #4
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or
        /// resetting unmanaged resources.
        /// </summary>
        public virtual void Dispose()
        {
            if (_taskExpiry != null)
            {
                _taskExpiry.Cancel();
                _taskExpiry = null;
            }


            if (_cdbSyncMgr != null)
            {
                _cdbSyncMgr.ClearResourcePools();
                //_cdbSyncMgr.Clear();
            }

            if (_notifBasedDepMgr != null)
            {
                _notifBasedDepMgr.EndOperations();
                _notifBasedDepMgr.Dispose(false);
                _notifBasedDepMgr.Clear();
                _notifBasedDepMgr = null;
            }


            lock (_status_mutex)
            {
                _mainIndex.Clear();
                _mainIndex = null;

                _transitoryIndex.Clear();
                _transitoryIndex = null;

                _expirationManagerSize = 0;
            }
            GC.SuppressFinalize(this);
        }
コード例 #5
0
 /// <summary>
 /// Start the auto-expiration task
 /// </summary>
 public void Start()
 {
     if (_taskExpiry == null)
     {
         _taskExpiry = new AutoExpirationTask(this, _cleanInterval);
         _context.TimeSched.AddTask(_taskExpiry);
     }
 }
コード例 #6
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or 
        /// resetting unmanaged resources.
        /// </summary>
        public virtual void Dispose()
        {
            if (_taskExpiry != null)
            {
                _taskExpiry.Cancel();                
                _taskExpiry = null;
            }

            lock (_status_mutex)
            {
                _mainIndex.Clear();
                _mainIndex = null;

                _transitoryIndex.Clear();
                _transitoryIndex = null;
                _expirationManagerSize = 0;
            }
            GC.SuppressFinalize(this);
        }