Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Oct 23, 2024
1 parent 4ed28d7 commit d0a3e7e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
15 changes: 14 additions & 1 deletion projects/RabbitMQ.Client/CreateChannelOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,23 @@ internal CreateChannelOptions(ConnectionConfig connectionConfig)
_connectionConfigContinuationTimeout = connectionConfig.ContinuationTimeout;
}

internal void WithConnectionConfig(ConnectionConfig connectionConfig)
private void WithConnectionConfig(ConnectionConfig connectionConfig)
{
_connectionConfigConsumerDispatchConcurrency = connectionConfig.ConsumerDispatchConcurrency;
_connectionConfigContinuationTimeout = connectionConfig.ContinuationTimeout;
}

internal static CreateChannelOptions CreateOrUpdate(CreateChannelOptions? createChannelOptions, ConnectionConfig config)
{
if (createChannelOptions is not null)
{
createChannelOptions.WithConnectionConfig(config);
return createChannelOptions;
}
else
{
return new CreateChannelOptions(config);
}
}
}
}
10 changes: 1 addition & 9 deletions projects/RabbitMQ.Client/Impl/AutorecoveringConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,7 @@ public async Task<IChannel> CreateChannelAsync(CreateChannelOptions? createChann
{
EnsureIsOpen();

if (createChannelOptions is null)
{
createChannelOptions = new CreateChannelOptions(_config);
}
else
{
createChannelOptions.WithConnectionConfig(_config);
}

createChannelOptions = CreateChannelOptions.CreateOrUpdate(createChannelOptions, _config);
RecoveryAwareChannel recoveryAwareChannel = await CreateNonRecoveringChannelAsync(createChannelOptions, cancellationToken)
.ConfigureAwait(false);

Expand Down
10 changes: 1 addition & 9 deletions projects/RabbitMQ.Client/Impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,7 @@ public Task<IChannel> CreateChannelAsync(CreateChannelOptions? createChannelOpti
{
EnsureIsOpen();

if (createChannelOptions is null)
{
createChannelOptions = new CreateChannelOptions(_config);
}
else
{
createChannelOptions.WithConnectionConfig(_config);
}

createChannelOptions = CreateChannelOptions.CreateOrUpdate(createChannelOptions, _config);
ISession session = CreateSession();
return Channel.CreateAndOpenAsync(createChannelOptions, session, cancellationToken);
}
Expand Down

0 comments on commit d0a3e7e

Please sign in to comment.