File tree Expand file tree Collapse file tree 3 files changed +60
-188
lines changed
projects/RabbitMQ.Client/Impl Expand file tree Collapse file tree 3 files changed +60
-188
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ internal abstract class AsyncRpcContinuation<T> : IRpcContinuation
5151
5252 private bool _disposedValue ;
5353
54- public AsyncRpcContinuation ( TimeSpan continuationTimeout , CancellationToken cancellationToken )
54+ protected AsyncRpcContinuation ( TimeSpan continuationTimeout , CancellationToken cancellationToken )
5555 {
5656 /*
5757 * Note: we can't use an ObjectPool for these because the netstandard2.0
Original file line number Diff line number Diff line change @@ -131,38 +131,27 @@ private async Task MaybeConfirmSelect(CancellationToken cancellationToken)
131131 if ( _publisherConfirmationsEnabled )
132132 {
133133 // NOTE: _rpcSemaphore is held
134- bool enqueued = false ;
135- var k = new ConfirmSelectAsyncRpcContinuation ( ContinuationTimeout , cancellationToken ) ;
134+ using var k = new ConfirmSelectAsyncRpcContinuation ( ContinuationTimeout , cancellationToken ) ;
136135
137- try
136+ if ( _nextPublishSeqNo == 0UL )
138137 {
139- if ( _nextPublishSeqNo == 0UL )
138+ if ( _publisherConfirmationTrackingEnabled )
140139 {
141- if ( _publisherConfirmationTrackingEnabled )
142- {
143- _confirmsTaskCompletionSources . Clear ( ) ;
144- }
145- _nextPublishSeqNo = 1 ;
140+ _confirmsTaskCompletionSources . Clear ( ) ;
146141 }
142+ _nextPublishSeqNo = 1 ;
143+ }
147144
148- enqueued = Enqueue ( k ) ;
145+ Enqueue ( k ) ;
149146
150- var method = new ConfirmSelect ( false ) ;
151- await ModelSendAsync ( in method , k . CancellationToken )
152- . ConfigureAwait ( false ) ;
147+ var method = new ConfirmSelect ( false ) ;
148+ await ModelSendAsync ( in method , k . CancellationToken )
149+ . ConfigureAwait ( false ) ;
153150
154- bool result = await k ;
155- Debug . Assert ( result ) ;
151+ bool result = await k ;
152+ Debug . Assert ( result ) ;
156153
157- return ;
158- }
159- finally
160- {
161- if ( false == enqueued )
162- {
163- k . Dispose ( ) ;
164- }
165- }
154+ return ;
166155 }
167156 }
168157
You can’t perform that action at this time.
0 commit comments