1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Test/MarcoController.cs
2016-12-07 10:19:16 +01:00

92 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)
{
/*
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)
{
Console.WriteLine("Polo!");
}
}
public class MarcoMessage
{
}
public class PoloMessage
{
}
public class PoloColorRequest
{
}
public class PoloColorResponse
{
}
}