public void Disconnect(string name) { var toRemove = new Queue <string>( _active .Where(s => s.Value.Name == name) .Select(s => s.Key) ); while (toRemove.Count > 0) { var key = toRemove.Peek(); EventProcessor removed = null; if (_active.TryRemove(key, out removed)) { toRemove.Dequeue(); } } }
public void AddProcessor(EventProcessor processor) { _active[processor.Name] = processor; }