I have an unending async in a kestrel server. Is there anything wrong with this:
public static async void infiniteAsync()
{
bool keepgoing = true;
// otherwise meaningless await to overcome
// "this 'async' method lacks await operators... will run synchronously"
await Task.Delay(100);
do
{
// streaming task that will never end;
}
while (keepgoing);
}
}
invoked by kestrel server
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseWebSockets();
infiniteAsync();
}