Skip to content

Commit 262fe50

Browse files
authored
Merge pull request #1321 from d-jagoda/long-running-task-in-connection
Start MainLoop with a Task marked as LongRunning
2 parents f3382d3 + 7eb81c1 commit 262fe50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ public void MaybeStartHeartbeatTimers()
850850

851851
public void StartMainLoop(bool useBackgroundThread)
852852
{
853-
_mainLoopTask = Task.Run((Action)MainLoop);
853+
_mainLoopTask = Task.Factory.StartNew(MainLoop, TaskCreationOptions.LongRunning | TaskCreationOptions.DenyChildAttach);
854854
}
855855

856856
public void HeartbeatReadTimerCallback(object state)

0 commit comments

Comments
 (0)