Ejemplo n.º 1
0
        private void MonitorSolutions(Connection connection) {
            var sub = connection.Subscribe();
            Console.WriteLine(" [*] Waiting for solutions on the {0} bus... To exit press CTRL+C", busName);

            while (true) {
                var e = sub.Next();
                var message = Encoding.UTF8.GetString(e.Body);
                Console.WriteLine(" [x] Received: {0}", message);
            }
        }
Ejemplo n.º 2
0
 private void PublishNeed(Connection connection) {
     string message = new NeedPacket().ToJson();
     connection.Publish(message);
     Console.WriteLine(" [x] Published {0} on the {1} bus", message, busName);
 }