SignalR.DefaultSubscription.AddEvent C# (CSharp) Method

AddEvent() public method

public AddEvent ( string eventKey, SignalR.Topic topic ) : bool
eventKey string
topic SignalR.Topic
return bool
        public override bool AddEvent(string eventKey, Topic topic)
        {
            lock (_lockObj)
            {
                // O(n), but small n and it's not common
                var index = _cursors.FindIndex(c => c.Key == eventKey);
                if (index == -1)
                {
                    _cursors.Add(new Cursor
                    {
                        Key = eventKey,
                        Id = GetMessageId(topic)
                    });

                    _cursorTopics.Add(topic);

                    return true;
                }

                return false;
            }
        }