-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Refactoring lib.VU and lib.Runner
The complicated handling of context in RunOnce is not necessary. Each of the new executors handles contexts and VUs very deliberately and precisely. We can separate the context handling to interrupt goja runtime and the actual running user's code. This PR introduces two new interfaces, "InitializedVU" annd "ActiveVU". InitializedVU is what Runner.NewVU will return, and is stored in ExecutionState.vus buffer. Whenever a InitializedVU is pull from the buffer, caller can call InitializedVU.Activate with VUActivationParams argument. This will return an ActiveVU, which will actually run the user's code. The InitializedVU.Activate will spawn a goroutine to track the context for interrupting script execution, and calling the callback function and return the VU to the buffer. Fixes #889 Fixes #1283
- Loading branch information
Showing
23 changed files
with
236 additions
and
208 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
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
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
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
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
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
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
Oops, something went wrong.