Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid ServiceBus*Options allocations #44885

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected ServiceBusClient()
/// Other values will be ignored; to configure the processor, please use the <see cref="ServiceBusClientOptions" />.
/// </remarks>
public ServiceBusClient(string connectionString) :
this(connectionString, new ServiceBusClientOptions())
this(connectionString, null as ServiceBusClientOptions)
{
}

Expand Down Expand Up @@ -192,7 +192,7 @@ public ServiceBusClient(
/// This is likely to be similar to <c>{yournamespace}.servicebus.windows.net</c>.</param>
/// <param name="credential">The Azure managed identity credential to use for authorization. Access controls may be specified by the Service Bus namespace.</param>
public ServiceBusClient(string fullyQualifiedNamespace, TokenCredential credential) :
this(fullyQualifiedNamespace, (object)credential, new ServiceBusClientOptions())
this(fullyQualifiedNamespace, (object)credential, null)
{
}

Expand Down Expand Up @@ -562,7 +562,7 @@ public virtual ServiceBusProcessor CreateProcessor(string queueName)
entityPath: queueName,
connection: Connection,
isSessionEntity: false,
options: new ServiceBusProcessorOptions());
options: null);
}

/// <summary>
Expand Down Expand Up @@ -619,7 +619,7 @@ public virtual ServiceBusProcessor CreateProcessor(
entityPath: EntityNameFormatter.FormatSubscriptionPath(topicName, subscriptionName),
connection: Connection,
isSessionEntity: false,
options: new ServiceBusProcessorOptions());
options: null);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,5 @@ public class ServiceBusSenderOptions
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override string ToString() => base.ToString();

/// <summary>
/// Creates a new copy of the current <see cref="ServiceBusReceiverOptions" />, cloning its attributes into a new instance.
/// </summary>
///
/// <returns>A new copy of <see cref="ServiceBusReceiverOptions" />.</returns>
internal ServiceBusSenderOptions Clone() =>
new ServiceBusSenderOptions
{
Identifier = Identifier
};
}
}
Loading