1
0
mirror of synced 2024-11-24 11:43:12 +01:00
Tapeti/Test/Program.cs

35 lines
987 B
C#
Raw Normal View History

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();
2016-12-07 10:19:16 +01:00
container.Register<MarcoEmitter>();
container.Register<Visualizer>();
container.RegisterSingleton<ISagaStore, SagaMemoryStore>();
2016-12-07 10:19:16 +01:00
var config = new TapetiConfig("test", new SimpleInjectorDependencyResolver(container))
.Use(new SagaMiddleware())
2016-12-07 10:19:16 +01:00
.RegisterAllControllers()
.Build();
using (var connection = new TapetiConnection(config))
2016-12-07 10:19:16 +01:00
{
Console.WriteLine("Subscribing...");
connection.Subscribe().Wait();
Console.WriteLine("Done!");
var emitter = container.GetInstance<MarcoEmitter>();
emitter.Run().Wait();
}
}
}
}