1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Examples/01-PublishSubscribe/ExamplePublisher.cs
Mark van Renswoude 8e0edabeed [skip appveyor] #9 Documentation and examples
Implemented two examples. More needed to get rid of the mess that is the current "Test" project.
2019-08-16 10:51:35 +02:00

30 lines
706 B
C#

using System.Threading.Tasks;
using Messaging.TapetiExample;
using Tapeti;
namespace _01_PublishSubscribe
{
public class ExamplePublisher
{
private readonly IPublisher publisher;
/// <summary>
/// Shows that the IPublisher is registered in the container by Tapeti
/// </summary>
/// <param name="publisher"></param>
public ExamplePublisher(IPublisher publisher)
{
this.publisher = publisher;
}
public async Task SendTestMessage()
{
await publisher.Publish(new PublishSubscribeMessage
{
Greeting = "Hello world of messaging!"
});
}
}
}