Blazor API Review: Server-side startup code
Fixes: #12220 Just some small tweaks here, it's already great.
This commit is contained in:
parent
e69d378442
commit
d992a1e2ef
|
|
@ -28,13 +28,13 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
}
|
}
|
||||||
namespace Microsoft.AspNetCore.Components.Server
|
namespace Microsoft.AspNetCore.Components.Server
|
||||||
{
|
{
|
||||||
public partial class CircuitOptions
|
public sealed partial class CircuitOptions
|
||||||
{
|
{
|
||||||
public CircuitOptions() { }
|
public CircuitOptions() { }
|
||||||
public bool DetailedErrors { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
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 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 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
|
public partial class ComponentPrerenderingContext
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ using System;
|
||||||
namespace Microsoft.AspNetCore.Components.Server
|
namespace Microsoft.AspNetCore.Components.Server
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Options to configure ASP.NET Core Components.
|
/// Options to configure circuit handler for server-side Blazor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CircuitOptions
|
public sealed class CircuitOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value that determines the maximum number of disconnected circuit state details
|
/// Gets or sets a value that determines the maximum number of disconnected circuit state details
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Components.Server
|
||||||
/// <value>
|
/// <value>
|
||||||
/// Defaults to <c>100</c>.
|
/// Defaults to <c>100</c>.
|
||||||
/// </value>
|
/// </value>
|
||||||
public int MaxRetainedDisconnectedCircuits { get; set; } = 100;
|
public int DisconnectedCircuitMaxRetained { get; set; } = 100;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value that determines the maximum duration state for a disconnected circuit is
|
/// Gets or sets a value that determines the maximum duration state for a disconnected circuit is
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Components.Server
|
||||||
/// </para>
|
/// </para>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// This value determines the maximium duration circuit state is retained by the server before being evicted.
|
/// This value determines the maximium duration circuit state is retained by the server before being evicted.
|
||||||
/// <seealso cref="MaxRetainedDisconnectedCircuits"/>
|
/// <seealso cref="DisconnectedCircuitMaxRetained"/>
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||||
|
|
||||||
DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions
|
DisconnectedCircuits = new MemoryCache(new MemoryCacheOptions
|
||||||
{
|
{
|
||||||
SizeLimit = _options.MaxRetainedDisconnectedCircuits,
|
SizeLimit = _options.DisconnectedCircuitMaxRetained,
|
||||||
});
|
});
|
||||||
|
|
||||||
_postEvictionCallback = new PostEvictionCallbackRegistration
|
_postEvictionCallback = new PostEvictionCallbackRegistration
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue