1
0
mirror of synced 2024-11-23 17:33:49 +00:00
Tapeti/Examples/08-MessageHandlerLogging/SlowMessageController.cs

31 lines
742 B
C#
Raw Normal View History

using System;
using System.Threading.Tasks;
using ExampleLib;
using Messaging.TapetiExample;
using Tapeti.Config.Annotations;
namespace _08_MessageHandlerLogging
{
[MessageController]
[DynamicQueue("tapeti.example.08.slow")]
public class SlowMessageController
{
private readonly IExampleState exampleState;
public SlowMessageController(IExampleState exampleState)
{
this.exampleState = exampleState;
}
public async Task GimmeASec(PublishSubscribeMessage message)
{
Console.WriteLine("Received message (in slow controller): " + message.Greeting);
await Task.Delay(1000);
exampleState.Done();
}
}
}