-
Notifications
You must be signed in to change notification settings - Fork 27
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
Explicit run-server
needed?
#17
Comments
Definitely a good question to ask. As is, the |
I guess the question that I have is how do I activate the HTTP client side of the world without also activating the HTTP serving side of the world? I could definitely do that in the host with a flag, but it feels a little weird that you could load a module that expects to be called to serve HTTP requests, but the host doesn't enable it, it feels like that should explicitly fail, rather than silently not work, but I'm not certain. |
Should there at least be a method in the world that is something like |
Ah, great question. I think a good way to express that is to define a distinct default world http-client {
import default-outgoing-HTTP: http.outgoing-handler
export cli.main
} (assuming we factor out the |
My 2 🪙: I typically view components as pieces that sit inside hosts, and I feel like the act of starting a server is the responsibility of the host in which a component resides. The host knows what port number to use, what CORS settings to have, what TLS termination there should be, etc.. these details are ones that I typically try and keep out of a wasm module. If a component can start its own server, it now has to be responsible for all of that configuration and networking baggage that we want the host to handle for us. It also makes it harder for an HTTP request handler to work in both serverless and microservice style deployments, where the former might be multiplexing or proxying requests in a way opaque to the component. In other words, in my ideal world, a component is concerned with what is inside the request and what to respond with, but not with how that request arrived or how the response will be delivered. |
While there is a method for handling web requests, there's no explicit method for starting a web server.
I don't know if we want to make this part of the interface, or we want to assume that there is a configured server that wraps this WASI module, but it seemed worth mentioning/asking.
cc @lukewagner
The text was updated successfully, but these errors were encountered: