Solution: Async Chat Logger

Review how to implement IAsyncDisposable on a utility class and trigger non-blocking resource cleanup using await using.

Solution: Async Chat Logger

Review how to implement IAsyncDisposable on a utility class and trigger non-blocking resource cleanup using await using.
C# 14.0
using System.Threading.Tasks;
namespace CodingExercise;
public class ChatLogger : IAsyncDisposable
{
public async ValueTask DisposeAsync()
{
Console.WriteLine("Closing chat connection asynchronously...");
await Task.Delay(1000);
Console.WriteLine("Chat connection closed safely.");
}
}