forked from reactjs/React.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIJavaScriptEngineFactory.cs
More file actions
36 lines (32 loc) · 1.06 KB
/
IJavaScriptEngineFactory.cs
File metadata and controls
36 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using JavaScriptEngineSwitcher.Core;
namespace React
{
/// <summary>
/// Handles creation of JavaScript engines. All methods are thread-safe.
/// </summary>
public interface IJavaScriptEngineFactory
{
/// <summary>
/// Gets the JavaScript engine for the current thread. It is recommended to use
/// <see cref="GetEngine"/> instead, which will pool/reuse engines.
/// </summary>
/// <returns>The JavaScript engine</returns>
IJsEngine GetEngineForCurrentThread();
/// <summary>
/// Disposes the JavaScript engine for the current thread. This should only be used
/// if the engine was acquired through <see cref="GetEngineForCurrentThread"/>.
/// </summary>
void DisposeEngineForCurrentThread();
/// <summary>
/// Gets a JavaScript engine from the pool.
/// </summary>
/// <returns>The JavaScript engine</returns>
IJsEngine GetEngine();
/// <summary>
/// Returns an engine to the pool so it can be reused
/// </summary>
/// <param name="engine">Engine to return</param>
void ReturnEngineToPool(IJsEngine engine);
}
}