Skip to content

Commit

Permalink
Allow setting max outstanding publisher confirms
Browse files Browse the repository at this point in the history
Part of #1682
  • Loading branch information
lukebakken committed Oct 18, 2024
1 parent 44dbd0a commit 6cab6ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 12 additions & 0 deletions projects/RabbitMQ.Client/Impl/Channel.BasicPublish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using RabbitMQ.Client.Framing;
Expand Down Expand Up @@ -220,5 +221,16 @@ void MaybeAddPublishSequenceNumberToHeaders(IDictionary<string, object?> headers
}
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private ValueTask EnforceFlowControlAsync(CancellationToken cancellationToken)
{
if (_flowControlBlock.IsSet)
{
return default;
}

return _flowControlBlock.WaitAsync(cancellationToken);
}
}
}
11 changes: 0 additions & 11 deletions projects/RabbitMQ.Client/Impl/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,6 @@ protected ValueTask ModelSendAsync<TMethod, THeader>(in TMethod method, in THead
return Session.TransmitAsync(in method, in header, body, cancellationToken);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected ValueTask EnforceFlowControlAsync(CancellationToken cancellationToken)
{
if (_flowControlBlock.IsSet)
{
return default;
}

return _flowControlBlock.WaitAsync(cancellationToken);
}

internal Task OnCallbackExceptionAsync(CallbackExceptionEventArgs args)
{
return _callbackExceptionAsyncWrapper.InvokeAsync(this, args);
Expand Down

0 comments on commit 6cab6ee

Please sign in to comment.