From 49ac282b6ac6ee3bd3b45ae2d2763e59afbaca21 Mon Sep 17 00:00:00 2001 From: danbugs Date: Fri, 4 Oct 2024 16:49:44 +0000 Subject: [PATCH] addressing first round of feedback: added type aliases, added remove-metadata method, added new-line at the end of files, improved argument names, removed .gitignore, improved documentation, changed get-subscriptions function name Signed-off-by: danbugs --- .gitignore | 2 -- README.md | 2 +- imports-request-reply.md | 31 ++++++++++++++++++------- imports.md | 25 ++++++++++++++++---- messaging-core.md | 40 +++++++++++++++++++++++--------- messaging-request-reply.md | 47 ++++++++++++++++++++++++++------------ wit/guest.wit | 12 +++++----- wit/messaging.wit | 23 +++++++++++++------ wit/producer.wit | 2 +- wit/request-reply.wit | 6 ++--- wit/types.wit | 16 +++++++++---- 11 files changed, 144 insertions(+), 62 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 00741cb..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -.idea/ \ No newline at end of file diff --git a/README.md b/README.md index 94212c5..01f7bbe 100644 --- a/README.md +++ b/README.md @@ -101,4 +101,4 @@ It would make sense for a lot of these functions to be asynchronous, but that is the component model. Asynchronous support will be added as part of WASI Preview 3. When async support becomes available, we plan to update the wasi-messaging interface to incorporate asynchronous patterns. -> **Note**: Ensure you have version 0.30.0 of `wit-bindgen` installed to avoid compatibility issues. \ No newline at end of file +> **Note**: Ensure you have version 0.30.0 of `wit-bindgen` installed to avoid compatibility issues. diff --git a/imports-request-reply.md b/imports-request-reply.md index 4c6d3be..bdfa2d6 100644 --- a/imports-request-reply.md +++ b/imports-request-reply.md @@ -1,4 +1,6 @@

World imports-request-reply

+

The imports-request-reply world extends imports by including the request-reply interface. +This allows the component to perform request/reply messaging patterns.

Return values

[method]message.add-metadata: func

Add a new key-value pair to the metadata, overwriting any existing value for the same key

@@ -137,6 +145,13 @@ message

  • key: string
  • value: string
  • +

    [method]message.remove-metadata: func

    +

    Remove a key-value pair from the metadata

    +
    Params
    +

    Import interface wasi:messaging/request-reply@0.2.0-draft

    The request-reply interface allows a guest to send a message and await a response. This interface is considered optional as not all message services support the concept of @@ -193,8 +208,8 @@ return the list of messages received up to that point.

    Params
    Return values