-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lib): Dispatch methods call, used by FSI
Dispatch is a new mechanism for handling calls invoked on the lib.Instance. Calls are sent to dispatch as a method name and input parameters. The actual implementation is looked up and then invokved using reflection. This allows the http api to layer itself directly on top of these same methods, which also lets us replace the old rpc style with the http api. It also nicely sets us up to introduce multi-tenancy and multi-processing, by having a single place that handles incoming requests. This mechanmism is introduced here, and only used for FSI now. Dispatch can be introduced gradually, and does not require changing the whole world at once. This PR should serve as a guide for how to do the same refactoring for other method groups. Note that each FSI method in FSIMethods is now a very thin call to Dispatch, and then a type coercion afterwards to get the correct return value. Actual implementations live at the bottom of the same source file, and each take a Scope, which is a new structure to control access to the otherwise global resources in Instance.
- Loading branch information
Showing
27 changed files
with
868 additions
and
484 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
Binary file not shown.
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.