From 18f12880524a0bca0596197ca64819b8d2147bb2 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Fri, 16 Aug 2024 14:35:31 +0200 Subject: [PATCH] fix: add `outgoing-value.finish` Without an explicit `outgoing-value.finish`, the host may not know when the data stream has finished and when to stop writing. Additionally, this allows for errors to be communicated to the guest, which may have happened asynchronously Signed-off-by: Roman Volosatovs --- imports.md | 20 ++++++++++++++++++++ wit/types.wit | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/imports.md b/imports.md index 6e50d1a..03f0a7b 100644 --- a/imports.md +++ b/imports.md @@ -521,6 +521,13 @@ Soon: switch to resource incoming-value { ... }
  • own<outgoing-value>
  • [method]outgoing-value.outgoing-value-write-body: func

    +

    Returns a stream for writing the value contents.

    +

    The returned output-stream is a child resource: it must be dropped +before the parent outgoing-value resource is dropped (or finished), +otherwise the outgoing-value drop or finish will trap.

    +

    Returns success on the first call: the output-stream resource for +this outgoing-value may be retrieved at most once. Subsequent calls +will return error.

    Params