Skip to content

Commit

Permalink
Merge pull request #863 from rabbitmq/rabbitmq-dotnet-client-855-2
Browse files Browse the repository at this point in the history
Re-merge pull request #855 from bollhals/remove.task.yield
  • Loading branch information
lukebakken authored Jun 16, 2020
2 parents c93144a + 0cd705e commit 7c9914a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions projects/RabbitMQ.Client/client/impl/Work.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;

namespace RabbitMQ.Client.Impl
{
Expand All @@ -12,17 +11,9 @@ protected Work(IBasicConsumer consumer)
_asyncConsumer = (IAsyncBasicConsumer)consumer;
}

public async Task Execute(ModelBase model)
public Task Execute(ModelBase model)
{
try
{
await Task.Yield();
await Execute(model, _asyncConsumer).ConfigureAwait(false);
}
catch (Exception)
{
// intentionally caught
}
return Execute(model, _asyncConsumer);
}

protected abstract Task Execute(ModelBase model, IAsyncBasicConsumer consumer);
Expand Down

0 comments on commit 7c9914a

Please sign in to comment.