コード例 #1
0
 public Core.Interfaces.IBus CreateBusWithHosting(bool reportRaw = false)
 {
     IBus bus = new Succubus.Core.Bus();
     bus.Initialize(config =>
     {
         config.WithLoopback(clear: true);
         if (reportRaw == true) {
             (config.Transport as Succubus.Backend.Loopback.Transport).ReportRaw = true;
         }
     });
     return bus;
 }
コード例 #2
0
ファイル: ZeroMQFactory.cs プロジェクト: techtronics/succubus
        public Core.Interfaces.IBus CreateBus(bool reportRaw = false)
        {
            IBus bus = new Succubus.Core.Bus();
            bus.Initialize(config => {
                config.WithZeroMQ();
                var transport = config.Transport as Succubus.Backend.ZeroMQ.Transport;
                if (reportRaw == true)
                {
                    transport.ReportRaw = true;
                }
            });

            return bus;
        }
コード例 #3
0
ファイル: Diagnostics.cs プロジェクト: techtronics/succubus
        public void CheckLogging()
        {
            var bus = new Succubus.Core.Bus();
            var memoryStream = new MemoryStream();
            bus.Initialize(config =>
            {
                config.WithLoopback();
                config.Name = "TestBus";
                config.LogWriter = new StreamWriter(memoryStream);
                config.LogLevel = Core.LogLevel.Trace;
            });

            memoryStream.Position = 0;
            var sr = new StreamReader(memoryStream);
            var myStr = sr.ReadToEnd();

            Assert.AreEqual("[Info] TestBus: Bus initialized\r\n", myStr);
        }