mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
18 lines
442 B
C#
18 lines
442 B
C#
using MQTTnet.Diagnostics;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MQTTnet.Internal
|
|
{
|
|
public static class TaskExtensions
|
|
{
|
|
public static void Forget(this Task task, IMqttNetScopedLogger logger)
|
|
{
|
|
task?.ContinueWith(t =>
|
|
{
|
|
logger.Error(t.Exception, "Unhandled exception.");
|
|
},
|
|
TaskContinuationOptions.OnlyOnFaulted);
|
|
}
|
|
}
|
|
}
|