1
0
mirror of synced 2024-06-29 15:27:40 +00:00
Tapeti/Test/MarcoEmitter.cs

53 lines
1.1 KiB
C#

using System.Threading.Tasks;
// ReSharper disable UnusedMember.Global
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);
}
// ReSharper disable once FunctionNeverReturns
}
}
}