1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Test/MarcoController.cs

94 lines
1.7 KiB
C#

using System;
using Microsoft.SqlServer.Server;
using Tapeti;
using Tapeti.Annotations;
namespace Test
{
[DynamicQueue]
public class MarcoController : MessageController
{
private readonly IPublisher publisher;
public MarcoController(IPublisher publisher/*, ISagaProvider sagaProvider*/)
{
this.publisher = publisher;
}
//[StaticQueue("test")]
public PoloMessage Marco(MarcoMessage message, Visualizer visualizer)
{
visualizer.VisualizeMarco();
/*
using (sagaProvider.Begin<MarcoState>(new MarcoState
{
...
}))
{
//publisher.Publish(new PoloColorRequest(), saga, PoloColorResponse1);
//publisher.Publish(new PoloColorRequest(), saga, callID = "tweede");
// Saga refcount = 2
}
*/
return new PoloMessage(); ;
}
/*
[CallID("eerste")]
Implicit:
using (sagaProvider.Continue(correlatieID))
{
saga refcount--;
public void PoloColorResponse1(PoloColorResponse message, ISaga<MarcoState> saga)
{
saga.State == MarcoState
state.Color = message.Color;
if (state.Complete)
{
publisher.Publish(new PoloMessage());
}
}
*/
public void Polo(PoloMessage message, Visualizer visualizer)
{
visualizer.VisualizePolo();
}
}
public class MarcoMessage
{
}
public class PoloMessage
{
}
public class PoloColorRequest
{
}
public class PoloColorResponse
{
}
}