Skip to content

Commit

Permalink
rename wasi-http interfaces to avoid conflicts with wasmtime-wasi
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
  • Loading branch information
dicej committed Aug 24, 2023
1 parent 9f1a0c0 commit 8b5cac5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/trigger-http/src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl HttpExecutor for WasiHttpExecutor {

let handle = task::spawn(async move {
let result = proxy
.wasi_http_incoming_handler()
.wasi_http_incoming_handler2()
.call_handle(&mut store, request, response)
.await;

Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-cloud/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
poll::{PollWaker, Pollable},
streams::{InputStream, OutputStream, Sender},
wit::wasi::http::{
outgoing_handler,
outgoing_handler2 as outgoing_handler,
types2::{self as types, Method, Scheme},
},
WasiCloud,
Expand Down
4 changes: 2 additions & 2 deletions examples/wasi-http-rust-async/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ wit_bindgen::generate!("proxy" in "../../wit/wasi-http");

use {
self::{
exports::wasi::http::incoming_handler::IncomingHandler,
exports::wasi::http::incoming_handler2::IncomingHandler2 as IncomingHandler,
wasi::{
http::{
outgoing_handler,
outgoing_handler2 as outgoing_handler,
types2::{self as types, IncomingRequest, Method, ResponseOutparam, Scheme},
},
io::streams2::{self as streams, StreamStatus},
Expand Down
2 changes: 1 addition & 1 deletion wit/wasi-http/incoming-handler.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// `wasi:http/outgoing-handler` into a single `wasi:http/handler` interface
// that takes a `request` parameter and returns a `response` result.
//
interface incoming-handler {
interface incoming-handler2 {
use types2.{incoming-request, response-outparam}

// The `handle` function takes an outparam instead of returning its response
Expand Down
2 changes: 1 addition & 1 deletion wit/wasi-http/outgoing-handler.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// `wasi:http/outgoing-handler` into a single `wasi:http/handler` interface
// that takes a `request` parameter and returns a `response` result.
//
interface outgoing-handler {
interface outgoing-handler2 {
use types2.{outgoing-request, request-options, future-incoming-response}

// The parameter and result types of the `handle` function allow the caller
Expand Down
4 changes: 2 additions & 2 deletions wit/wasi-http/proxy.wit
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ world proxy {

// This is the default handler to use when user code simply wants to make an
// HTTP request (e.g., via `fetch()`).
import outgoing-handler
import outgoing-handler2

// The host delivers incoming HTTP requests to a component by calling the
// `handle` function of this exported interface. A host may arbitrarily reuse
// or not reuse component instance when delivering incoming HTTP requests and
// thus a component must be able to handle 0..N calls to `handle`.
export incoming-handler
export incoming-handler2
}

0 comments on commit 8b5cac5

Please sign in to comment.