Skip to content

Commit 6cab6ee

Browse files
committed
Allow setting max outstanding publisher confirms
Part of #1682
1 parent 44dbd0a commit 6cab6ee

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

projects/RabbitMQ.Client/Impl/Channel.BasicPublish.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using System;
3333
using System.Collections.Generic;
3434
using System.Diagnostics;
35+
using System.Runtime.CompilerServices;
3536
using System.Threading;
3637
using System.Threading.Tasks;
3738
using RabbitMQ.Client.Framing;
@@ -220,5 +221,16 @@ void MaybeAddPublishSequenceNumberToHeaders(IDictionary<string, object?> headers
220221
}
221222
}
222223
}
224+
225+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
226+
private ValueTask EnforceFlowControlAsync(CancellationToken cancellationToken)
227+
{
228+
if (_flowControlBlock.IsSet)
229+
{
230+
return default;
231+
}
232+
233+
return _flowControlBlock.WaitAsync(cancellationToken);
234+
}
223235
}
224236
}

projects/RabbitMQ.Client/Impl/Channel.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -450,17 +450,6 @@ protected ValueTask ModelSendAsync<TMethod, THeader>(in TMethod method, in THead
450450
return Session.TransmitAsync(in method, in header, body, cancellationToken);
451451
}
452452

453-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
454-
protected ValueTask EnforceFlowControlAsync(CancellationToken cancellationToken)
455-
{
456-
if (_flowControlBlock.IsSet)
457-
{
458-
return default;
459-
}
460-
461-
return _flowControlBlock.WaitAsync(cancellationToken);
462-
}
463-
464453
internal Task OnCallbackExceptionAsync(CallbackExceptionEventArgs args)
465454
{
466455
return _callbackExceptionAsyncWrapper.InvokeAsync(this, args);

0 commit comments

Comments
 (0)