2016-11-20 13:34:50 +00:00
|
|
|
|
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-11-20 13:34:50 +00:00
|
|
|
|
|
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
|
|
|
|
{
|
2016-11-20 13:34:50 +00:00
|
|
|
|
Console.WriteLine("Subscribing...");
|
|
|
|
|
connection.Subscribe().Wait();
|
|
|
|
|
Console.WriteLine("Done!");
|
|
|
|
|
|
2016-12-05 07:00:09 +00:00
|
|
|
|
var emitter = container.GetInstance<MarcoEmitter>();
|
|
|
|
|
emitter.Run().Wait();
|
2016-11-20 13:34:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|