Skip to content

Commit aa5e8cb

Browse files
committed
Revert "Merge pull request #855 from bollhals/remove.task.yield"
This reverts commit c395ca4, reversing changes made to ef01562.
1 parent c395ca4 commit aa5e8cb

File tree

1 file changed

+12
-3
lines changed
  • projects/RabbitMQ.Client/client/impl

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading.Tasks;
1+
using System;
2+
using System.Threading.Tasks;
23

34
namespace RabbitMQ.Client.Impl
45
{
@@ -11,9 +12,17 @@ protected Work(IBasicConsumer consumer)
1112
_asyncConsumer = (IAsyncBasicConsumer)consumer;
1213
}
1314

14-
public Task Execute(ModelBase model)
15+
public async Task Execute(ModelBase model)
1516
{
16-
return Execute(model, _asyncConsumer);
17+
try
18+
{
19+
await Task.Yield();
20+
await Execute(model, _asyncConsumer).ConfigureAwait(false);
21+
}
22+
catch (Exception)
23+
{
24+
// intentionally caught
25+
}
1726
}
1827

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

0 commit comments

Comments
 (0)