From 47238f942947d9dd3b872b683d8e330763e07488 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Wed, 29 Nov 2017 14:40:58 +0100 Subject: [PATCH] Use Task.Run instead of Task.Factory.StartNew (#4) --- Src/LiquidProjections.PollingEventStore/Subscription.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Src/LiquidProjections.PollingEventStore/Subscription.cs b/Src/LiquidProjections.PollingEventStore/Subscription.cs index 3bdffc3..7df6948 100644 --- a/Src/LiquidProjections.PollingEventStore/Subscription.cs +++ b/Src/LiquidProjections.PollingEventStore/Subscription.cs @@ -55,7 +55,7 @@ public void Start() CancellationToken = cancellationTokenSource.Token }; - Task = Task.Factory.StartNew(async () => + Task = Task.Run(async () => { try { @@ -72,10 +72,7 @@ public void Start() exception); } }, - CancellationToken.None, - TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, - TaskScheduler.Default) - .Unwrap(); + CancellationToken.None); } }