-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Wagi HTTP executor #54
Conversation
The one Wagi feature that will most likely not be part of this is a module defining its own routes using a Because an executor doesn't have access to the underlying Wasm engine instantiation, there is no way for it to do that at startup and augment the route table (ref #19 ). |
/// This is the default Wagi entrypoint. | ||
/// There should be a way to set this in the component | ||
/// configuration of the trigger / executor. | ||
const WAGI_DEFAULT_ENTRYPOINT: &str = "_start"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: allow custom entrypoints in the component configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #69 to track this.
This commit implements a Wagi HTTP executor by importing the Wagi project in order to: * parse the headers from a Hyper request into CGI headers * consume the standard output of the module to form the response This allows a Spin application to have components that are executed by Wagi, which enables writing modules from all languages that compile to WASI. Signed-off-by: Radu Matei <radu.matei@fermyon.com>
ref #34
This draft PR is a prototype for running both Spin and Wagi HTTP executors.
It adapts the response composition logic from Wagi, and reuses the module instantiation from the underlying execution context.
A robust implementation would import the Wagi core as a crate and reuse the logic for headers, query parameters, and responses.
This should remain a draft until this implementation follows the Wagi spec closely.
WIth this change, a component of an HTTP application could define
wagi
as its executor:Signed-off-by: Radu Matei radu.matei@fermyon.com