1
0
mirror of synced 2024-11-14 22:33:50 +00:00
Tapeti/Test/MarcoEmitter.cs
Menno van Lavieren 3ce847c21f RDB-46 Volgorde bug in Flow Library
Refactoring van de FlowStore en de FlowPovider met de oplossing voor de bug
2017-10-17 10:34:07 +02:00

51 lines
1.0 KiB
C#

using System.Threading;
using System.Threading.Tasks;
using Tapeti;
namespace Test
{
public class MarcoEmitter
{
private readonly IPublisher publisher;
public MarcoEmitter(IPublisher publisher)
{
this.publisher = publisher;
}
public async Task Run()
{
//await publisher.Publish(new MarcoMessage());
/*
var concurrent = new SemaphoreSlim(20);
while (true)
{
for (var x = 0; x < 200; x++)
{
await concurrent.WaitAsync();
try
{
await publisher.Publish(new MarcoMessage());
}
finally
{
concurrent.Release();
}
}
await Task.Delay(200);
}
*/
while (true)
{
await Task.Delay(1000);
}
}
}
}