1
0
mirror of synced 2024-11-24 19:53:10 +01:00
Tapeti/Examples/04-Transient/UsersMessageController.cs
Mark van Renswoude 7075baeb80 [skip appveyor] #9 Documentation and examples
Added YieldWithParallelRequest and Tapeti.Transient examples.
2019-08-17 14:19:29 +02:00

25 lines
670 B
C#

using System;
using System.Threading.Tasks;
using Messaging.TapetiExample;
using Tapeti.Annotations;
namespace _04_Transient
{
[MessageController]
[DynamicQueue("tapeti.example.04")]
public class UsersMessageController
{
// No publisher required, responses can simply be returned
public async Task<LoggedInUsersResponseMessage> HandleQuoteRequest(LoggedInUsersRequestMessage message)
{
// Simulate the response taking some time
await Task.Delay(1000);
return new LoggedInUsersResponseMessage
{
Count = new Random().Next(0, 100)
};
}
}
}