1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Test/Program.cs

36 lines
954 B
C#
Raw Normal View History

using System;
using SimpleInjector;
using Tapeti;
using Tapeti.SimpleInjector;
namespace Test
{
internal class Program
{
private static void Main()
{
var container = new Container();
2016-12-07 09:19:16 +00:00
container.Register<MarcoEmitter>();
var topology = new TapetiTopologyBuilder()
.RegisterAllControllers()
.Build();
2016-12-05 22:41:17 +00:00
using (var connection = new TapetiConnectionBuilder()
.SetExchange("test")
.SetDependencyResolver(new SimpleInjectorDependencyResolver(container))
2016-12-07 09:19:16 +00:00
.SetTopology(topology)
2016-12-05 22:41:17 +00:00
.Build())
2016-12-07 09:19:16 +00:00
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}