-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A boot() method to explicitly initialize the PHP worker (#1669)
## Motivation for the change, related issues Refactors the `remote.html` and `worker-thread.ts` boot flows. * **Before this PR**, both files passed configuration using query arguments and relied on implicit logic surrounding the endpoint class * **After this PR**, both API Endpoint classes expose a `boot()` method that is strongly typed, accepts the configuration values, and explicitly orchestrates all the boot logic when it is called. This work may eventually enable: * A reusable, isomorphic Worker implementation that can be reused in the browser and in a local CLI setup. * Exposing `bootWordPress()` on a worker instance. * Hot-swapping the PHP runtime and WordPress instance (e.g. by killing the current worker and starting a new one). * Spawning new workers, not just PHP class instances, via PHPProcessManager. Related to #1398 ## Follow-up work * Explore spawning multiple workers for handling requests. This might also require: * Exposing the full boot protocol (`bootWordPress()`) on a worker instance instead of the simplified `boot()` method. * Load balancer across all workers handling the same site instance. * An OPFS Emscripten filesystem backend so that each worker can see the changes made by other workers. This is a potential blocker as Emscripten didn't seem to have a good way of doing that a few months ago. ## Testing Instructions (or ideally a Blueprint) * Confirm the tests are all green * Carefully review the changes, point out anything that seems off cc @brandonpayton @bgrgicak --------- Co-authored-by: Brandon Payton <brandon@happycode.net>
- Loading branch information
1 parent
298438b
commit ccadc7d
Showing
37 changed files
with
896 additions
and
1,096 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.