private static void read() { foreach (object o in _messages.GetConsumingEnumerable(_cancellationSource.Token)) { // TODO -- should this be async as well? Or assume that the remote listener will handle it? var json = MessagingHub.ToJson(o); _remoteListener.Send(json); // TODO -- send to a local messaging hub? } }
/// <summary> /// Really only for testing /// </summary> /// <param name="message"></param> public void SendObject(object message) { Send(MessagingHub.ToJson(message)); }