File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,17 @@ public interface IReactSiteConfiguration
102102 /// </summary>
103103 IReactSiteConfiguration SetMaxEngines ( int ? maxEngines ) ;
104104
105+ /// <summary>
106+ /// Gets or sets the maximum number of times an engine can be reused before it is disposed.
107+ /// <c>0</c> is unlimited. Defaults to <c>100</c>.
108+ /// </summary>
109+ int ? MaxUsagesPerEngine { get ; set ; }
110+ /// <summary>
111+ /// Sets the maximum number of times an engine can be reused before it is disposed.
112+ /// <c>0</c> is unlimited. Defaults to <c>100</c>.
113+ /// </summary>
114+ IReactSiteConfiguration SetMaxUsagesPerEngine ( int ? maxUsagesPerEngine ) ;
115+
105116 /// <summary>
106117 /// Gets or sets whether the MSIE engine should be used if V8 is unavailable.
107118 /// </summary>
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ protected virtual IJsPool CreatePool()
100100 {
101101 poolConfig . StartEngines = _config . StartEngines . Value ;
102102 }
103+ if ( _config . MaxUsagesPerEngine != null )
104+ {
105+ poolConfig . MaxUsagesPerEngine = _config . MaxUsagesPerEngine . Value ;
106+ }
103107
104108 var pool = new JsPool ( poolConfig ) ;
105109 // Reset the recycle exception on recycle. If there *are* errors loading the scripts
Original file line number Diff line number Diff line change @@ -191,6 +191,21 @@ public IReactSiteConfiguration SetMaxEngines(int? maxEngines)
191191 return this ;
192192 }
193193
194+ /// <summary>
195+ /// Gets or sets the maximum number of times an engine can be reused before it is disposed.
196+ /// <c>0</c> is unlimited. Defaults to <c>100</c>.
197+ /// </summary>
198+ public int ? MaxUsagesPerEngine { get ; set ; }
199+ /// <summary>
200+ /// Sets the maximum number of times an engine can be reused before it is disposed.
201+ /// <c>0</c> is unlimited. Defaults to <c>100</c>.
202+ /// </summary>
203+ public IReactSiteConfiguration SetMaxUsagesPerEngine ( int ? maxUsagesPerEngine )
204+ {
205+ MaxUsagesPerEngine = maxUsagesPerEngine ;
206+ return this ;
207+ }
208+
194209 /// <summary>
195210 /// Gets or sets whether the MSIE engine should be used if V8 is unavailable.
196211 /// </summary>
You can’t perform that action at this time.
0 commit comments