-
-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Advanced API and ProcessTasks (#1499)
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Jint.Tests.PublicInterface; | ||
|
||
public class AdvancedApiTests | ||
{ | ||
[Fact] | ||
public void CanProcessTasks() | ||
{ | ||
var engine = new Engine(); | ||
engine.Advanced.ProcessTasks(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Jint; | ||
|
||
public partial class Engine | ||
{ | ||
public AdvancedOperations Advanced { get; } | ||
} | ||
|
||
public class AdvancedOperations | ||
{ | ||
private readonly Engine _engine; | ||
|
||
public AdvancedOperations(Engine engine) | ||
{ | ||
_engine = engine; | ||
} | ||
|
||
/// <summary> | ||
/// Forcefully processes the current task queues (micro and regular), this API may break and change behavior! | ||
/// </summary> | ||
public void ProcessTasks() | ||
{ | ||
_engine.RunAvailableContinuations(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters