1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Test/Program.cs
2016-12-14 20:28:17 +01:00

35 lines
987 B
C#

using System;
using SimpleInjector;
using Tapeti;
using Tapeti.Saga;
using Tapeti.SimpleInjector;
namespace Test
{
internal class Program
{
private static void Main()
{
var container = new Container();
container.Register<MarcoEmitter>();
container.Register<Visualizer>();
container.RegisterSingleton<ISagaStore, SagaMemoryStore>();
var config = new TapetiConfig("test", new SimpleInjectorDependencyResolver(container))
.Use(new SagaMiddleware())
.RegisterAllControllers()
.Build();
using (var connection = new TapetiConnection(config))
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}