GetJavaScriptEnginePool(Action<IJavaScriptEngine>, int, int, int, TimeSpan?) Method
Gets a new IJavaScriptEnginePool. The returned engine pool should be disposed when no longer needed.
Containing Type


IJavaScriptEnginePool GetJavaScriptEnginePool(Action<IJavaScriptEngine> initializer = null, int startEngines = 10, int maxEngines = 25, int maxUsagesPerEngine = 100, TimeSpan? engineTimeout = null)


Name Type Description
initializer Action<IJavaScriptEngine> The code to run when a new engine is created. This should configure the environment and set up any required JavaScript libraries.
startEngines int The number of engines to initially start when a pool is created.
maxEngines int The maximum number of engines that will be created in the pool.
maxUsagesPerEngine int The maximum number of times an engine can be reused before it is disposed.
engineTimeout TimeSpan? The default timeout to use when acquiring an engine from the pool (defaults to 5 seconds). If an engine can not be acquired in this time frame, an exception will be thrown.

Return Value

Type Description
IJavaScriptEnginePool A new JavaScript engine pool.