/// <summary> /// Registers a new client for updates by adding its update callback to the list of callbacks /// </summary> /// <param name="connection">Client connection</param> /// <param name="clientCallback">Callback to be invoked on client to process updates</param> internal void RegisterToClientUpdates(Connection connection, ClientFunction clientCallback) { lock (CallbackRegistryLock) { if (!ClientCallbacks.ContainsKey(connection)) { ClientCallbacks.Add(connection, clientCallback); } } }
/// <summary> /// Stops sending updates to a client by removing its callback from the callback registry. /// <param name="connection">Client connection</param> /// </summary> internal void StopClientUpdates(Connection connection) { lock (CallbackRegistryLock) { if (ClientCallbacks.ContainsKey(connection)) { ClientCallbacks.Remove(connection); } } }