Skip to content

Commit

Permalink
* Allow cancellation of final await for publisher confirmation in `Ba…
Browse files Browse the repository at this point in the history
…sicPublishAsync`

* Fix `dotnet format` verification error
  • Loading branch information
lukebakken committed Sep 27, 2024
1 parent 6d7e576 commit 2c03295
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions projects/RabbitMQ.Client/Impl/ChannelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,7 @@ await _confirmSemaphore.WaitAsync(cancellationToken)

if (publisherConfirmationTcs is not null)
{
// TODO timeout?
await publisherConfirmationTcs.Task
await publisherConfirmationTcs.Task.WaitAsync(cancellationToken)
.ConfigureAwait(false);
}
}
Expand Down Expand Up @@ -1168,8 +1167,7 @@ await _confirmSemaphore.WaitAsync(cancellationToken)

if (publisherConfirmationTcs is not null)
{
// TODO timeout?
await publisherConfirmationTcs.Task
await publisherConfirmationTcs.Task.WaitAsync(cancellationToken)
.ConfigureAwait(false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion projects/Test/Integration/TestAsyncConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ private async Task ValidateConsumerDispatchConcurrency()
Assert.Equal(ConsumerDispatchConcurrency, autorecoveringChannel.ConsumerDispatcher.Concurrency);
Assert.Equal(_consumerDispatchConcurrency, autorecoveringChannel.ConsumerDispatcher.Concurrency);
await using IChannel ch = await _conn.CreateChannelAsync(
new CreateChannelOptions { ConsumerDispatchConcurrency = expectedConsumerDispatchConcurrency});
new CreateChannelOptions { ConsumerDispatchConcurrency = expectedConsumerDispatchConcurrency });
AutorecoveringChannel ach = (AutorecoveringChannel)ch;
Assert.Equal(expectedConsumerDispatchConcurrency, ach.ConsumerDispatcher.Concurrency);
}
Expand Down

0 comments on commit 2c03295

Please sign in to comment.