Example #1
0
        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?
            }
        }
Example #2
0
 /// <summary>
 /// Really only for testing
 /// </summary>
 /// <param name="message"></param>
 public void SendObject(object message)
 {
     Send(MessagingHub.ToJson(message));
 }
Example #3
0
 public void Send(object o, MessagingHub listeners)
 {
     listeners.Send(o.As <T>());
 }