From b641ebff0be1399baecf4a100555f76b69cdf7cb Mon Sep 17 00:00:00 2001
From: Roman Volosatovs
Date: Mon, 4 Dec 2023 14:08:52 +0100
Subject: [PATCH] feat: introduce `outgoing-request.into-incoming-request`
Signed-off-by: Roman Volosatovs
---
proxy.md | 12 ++++++++++++
wit/types.wit | 5 +++++
2 files changed, 17 insertions(+)
diff --git a/proxy.md b/proxy.md
index cf8856d..d536147 100644
--- a/proxy.md
+++ b/proxy.md
@@ -1032,6 +1032,18 @@ another component by e.g. outgoing-handler.handle
.
+
+Takes ownership of outgoing-request
, and returns an incoming-request
.
+This allows guests to invoke incoming-handler.handle
on other components.
+This function will trap if the headers
child is still alive.
+Params
+
+Return values
+
Construct a default request-options
value.
Return values
diff --git a/wit/types.wit b/wit/types.wit
index b1ea89d..0da0c82 100644
--- a/wit/types.wit
+++ b/wit/types.wit
@@ -306,6 +306,11 @@ interface types {
/// `outgoing-request` is dropped, or its ownership is transfered to
/// another component by e.g. `outgoing-handler.handle`.
headers: func() -> headers;
+
+ /// Takes ownership of `outgoing-request`, and returns an `incoming-request`.
+ /// This allows guests to invoke `incoming-handler.handle` on other components.
+ /// This function will trap if the `headers` child is still alive.
+ into-incoming-request: static func(this: outgoing-request) -> incoming-request;
}
/// Parameters for making an HTTP Request. Each of these parameters is