/// <summary> /// Detach the client from reading it's messages /// </summary> public void Detach(TmqClient client) { client.MessageReceived -= ClientOnMessageReceived; lock (_attachedClients) _attachedClients.Remove(client); }
/// <summary> /// Attach the client to the message reader and starts to read messages /// </summary> public void Attach(TmqClient client) { client.MessageReceived += ClientOnMessageReceived; lock (_attachedClients) _attachedClients.Add(client); }
public MessageFollower(TmqClient client) { _client = client; }
/// <summary> /// Reads the received model, if there is subscription to the model, trigger the actions. /// Use this method when you can't attach the client easily or directly. (ex: use for connections) /// </summary> public void Read(TmqClient sender, TmqMessage message) { ClientOnMessageReceived(sender, message); }