Skip to content

Blazor API Review: Server-side startup code #12371

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

Merged
merged 1 commit into from
Jul 19, 2019
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 @@ -28,13 +28,13 @@ public static partial class ComponentEndpointRouteBuilderExtensions
}
namespace Microsoft.AspNetCore.Components.Server
{
public partial class CircuitOptions
public sealed partial class CircuitOptions
{
public CircuitOptions() { }
public bool DetailedErrors { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public int DisconnectedCircuitMaxRetained { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public System.TimeSpan DisconnectedCircuitRetentionPeriod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public System.TimeSpan JSInteropDefaultCallTimeout { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public int MaxRetainedDisconnectedCircuits { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
}
public partial class ComponentPrerenderingContext
{
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Server/src/CircuitOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace Microsoft.AspNetCore.Components.Server
{
/// <summary>
/// Options to configure ASP.NET Core Components.
/// Options to configure circuit handler for server-side Blazor
/// </summary>
public class CircuitOptions
public sealed class CircuitOptions
{
/// <summary>
/// Gets or sets a value that determines the maximum number of disconnected circuit state details
Expand All @@ -26,7 +26,7 @@ public class CircuitOptions
/// <value>
/// Defaults to <c>100</c>.
/// </value>
public int MaxRetainedDisconnectedCircuits { get; set; } = 100;
public int DisconnectedCircuitMaxRetained { get; set; } = 100;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to be consistent with DisconnectedCircuitRetentionPeriod


/// <summary>
/// Gets or sets a value that determines the maximum duration state for a disconnected circuit is
Expand All @@ -38,7 +38,7 @@ public class CircuitOptions
/// </para>
/// <para>
/// This value determines the maximium duration circuit state is retained by the server before being evicted.
/// <seealso cref="MaxRetainedDisconnectedCircuits"/>
/// <seealso cref="DisconnectedCircuitMaxRetained"/>
/// </para>
/// </summary>
/// <value>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Server/src/Circuits/CircuitRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CircuitRegistry(

DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions
{
SizeLimit = _options.MaxRetainedDisconnectedCircuits,
SizeLimit = _options.DisconnectedCircuitMaxRetained,
});

_postEvictionCallback = new PostEvictionCallbackRegistration
Expand Down