- Imports:
- interface
wasi:messaging/[email protected]
- interface
wasi:messaging/[email protected]
- interface
wasi:messaging/[email protected]
- interface
Import interface wasi:messaging/[email protected]
A connection to a message-exchange service (e.g., buffer, broker, etc.).
TODO(danbugs): This should be eventually extracted as an underlying type for other wasi-cloud-core interfaces.
string
There are two types of channels: - publish-subscribe channel, which is a broadcast channel, and - point-to-point channel, which is a unicast channel.
The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.
Configuration includes a required list of channels the guest is subscribing to, and an optional list of extensions key-value pairs (e.g., partitions/offsets to read from in Kafka/EventHubs, QoS etc.).
channels
: list<channel
>extensions
: option<list<(string
,string
)>>
Format specification for messages
- more info: https://github.com/clemensv/spec/blob/registry-extensions/registry/spec.md#message-formats
- message metadata can further decorate w/ things like format version, and so on.
A message with a binary payload, a format specification, and decorative metadata.
data
: list<u8
>format
:format-spec
metadata
: option<list<(string
,string
)>>
Import interface wasi:messaging/[email protected]
#### `type channel` [`channel`](#channel)
#### `type message` [`message`](#message)
#### `type error` [`error`](#error)
----
- result<_, own<
error
>>
Import interface wasi:messaging/[email protected]
#### `type message` [`message`](#message)
#### `type channel` [`channel`](#channel)
#### `type error` [`error`](#error)
#### `type guest-configuration` [`guest-configuration`](#guest_configuration)
----
Blocking receive for t-milliseconds with ephemeral subscription – if no message is received, returns None
Blocking receive until message with ephemeral subscription
'Fit-all' type function for updating a guest's configuration – this could be useful for:
- unsubscribing from a channel,
- checkpointing,
- etc..
- result<_, own<
error
>>
A message can exist under several statuses: (1) available: the message is ready to be read, (2) acquired: the message has been sent to a consumer (but still exists in the queue), (3) accepted (result of complete-message): the message has been received and ACK-ed by a consumer and can be safely removed from the queue, (4) rejected (result of abandon-message): the message has been received and NACK-ed by a consumer, at which point it can be:
- deleted,
- sent to a dead-letter queue, or
- kept in the queue for further processing.
m
:message
- result<_, own<
error
>>
m
:message
- result<_, own<
error
>>