Exemple #1
0
        public void SpeedTest()
        {
            _bus.Subscribe("Event", _processor);

            Packet packet = new Packet()
            {
                Service = "Output",
                Command = "Print",
                Data    = "OK",
            };

            packet.Args.Add(new string[] { "arg1", "arg2" });
            packet.Options.Add(new Dictionary <string, string>()
            {
                { "opt1", "1" }, { "opt2", "2" }
            });

            //for (int i = 0; i < 5; i++)
            //{
            //    Task.Factory.StartNew(() => {
            //        var bus = new RabbitBus(new Uri("amqp://*****:*****@192.168.31.102:5672"), "Cactus.Bus");
            //        while (true)
            //        {
            //            bus.Publish("Event", packet);
            //        }
            //    });
            //}

            while (true)
            {
                _bus.Publish("Event", packet);
            }
        }
Exemple #2
0
 public void SubscribeTest()
 {
     _bus.Subscribe("Event", _processor);
     while (true)
     {
         Thread.Sleep(0);
     }
 }