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); } }
/// <summary> /// Start the auto-expiration task /// </summary> public void Start() { if (_taskExpiry == null) { _taskExpiry = new AutoExpirationTask(this, _cleanInterval); _context.TimeSched.AddTask(_taskExpiry); } }
/// <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); }
/// <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); }
/// <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); }