Skip to content

Commit

Permalink
Remove some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper-d committed Aug 3, 2020
1 parent fd69ff3 commit 199b334
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/NATS.Client/Internals/InFlightRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal sealed class InFlightRequest : IDisposable
private readonly CancellationToken _clientProvidedToken;
#if NET45
// TaskCreationOptions.RunContinuationsAsynchronously is not available in NET45 to avoid execution of continuations
// on the thread that executed TrySetResult/Canceled/Exception. Instead we use Task.Run() when setting _waiter (see below).
// on the thread that executed TrySetResult/Canceled/Exception. Instead we use Task.Run() when setting _waiter's result.
private readonly TaskCompletionSource<Msg> _waiter = new TaskCompletionSource<Msg>();
#else
private readonly TaskCompletionSource<Msg> _waiter = new TaskCompletionSource<Msg>(TaskCreationOptions.RunContinuationsAsynchronously);
Expand Down Expand Up @@ -96,7 +96,6 @@ private static void CancellationCallback(object req)
internal void TrySetResult(Msg msg)
{
#if NET45
// c.f. _waiter's TaskCreationOptions
var _ = System.Threading.Tasks.Task.Run(() => _waiter.TrySetResult(msg));
#else
_waiter.TrySetResult(msg);
Expand All @@ -110,7 +109,6 @@ internal void TrySetResult(Msg msg)
internal void TrySetException(Exception ex)
{
#if NET45
// c.f. _waiter's TaskCreationOptions
var _ = System.Threading.Tasks.Task.Run(() => _waiter.TrySetException(ex));
#else
_waiter.TrySetException(ex);
Expand All @@ -123,7 +121,6 @@ internal void TrySetException(Exception ex)
internal void TrySetCanceled()
{
#if NET45
// c.f. _waiter's TaskCreationOptions
var _ = System.Threading.Tasks.Task.Run(() => _waiter.TrySetCanceled());
#else
_waiter.TrySetCanceled();
Expand Down

0 comments on commit 199b334

Please sign in to comment.