public void SubscribeTo(string topic, ReceiveDataDelegate subscriberHandler) { if (!subscriptions.ContainsKey(topic)) { string connectionStr = requestCtrl.GetSubConnectionString(); Subscription subscription = new Subscription(connectionStr, topic); subscriptions.Add(topic, subscription); // subscriptions[topic].OnReceiveData += Logging; } subscriptions[topic].OnReceiveData += subscriberHandler; }
public void SubscribeTo(string topic, ReceiveDataDelegate subscriberHandler) { if (!IsConnected) { Debug.LogWarning("Not connected!"); return; } if (!subscriptions.ContainsKey(topic)) { string connectionStr = requestCtrl.GetSubConnectionString(); Subscription subscription = new Subscription(connectionStr, topic); subscriptions.Add(topic, subscription); } subscriptions[topic].OnReceiveData += subscriberHandler; }