Skip to content

Commit

Permalink
feat(*): add semicolons to all the interfaces
Browse files Browse the repository at this point in the history
Signed-off-by: Jiaxiao Zhou (Mossaka) <[email protected]>
  • Loading branch information
Mossaka committed Jan 12, 2024
1 parent f8b0bea commit 2560eb6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions wit/consumer.wit
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
interface consumer {
// {client, message, channel, error, guest-configuration}
use messaging-types.{client, message, channel, error, guest-configuration}
use messaging-types.{client, message, channel, error, guest-configuration};

/// Blocking receive for t-milliseconds with ephemeral subscription – if no message is received, returns None
subscribe-try-receive: func(c: client, ch: channel, t-milliseconds: u32) -> result<option<list<message>>, error>
subscribe-try-receive: func(c: client, ch: channel, t-milliseconds: u32) -> result<option<list<message>>, error>;

/// Blocking receive until message with ephemeral subscription
subscribe-receive: func(c: client, ch: channel) -> result<list<message>, error>
subscribe-receive: func(c: client, ch: channel) -> result<list<message>, error>;

/// 'Fit-all' type function for updating a guest's configuration – this could be useful for:
/// - unsubscribing from a channel,
/// - checkpointing,
/// - etc..
update-guest-configuration: func(gc: guest-configuration) -> result<_, error>
update-guest-configuration: func(gc: guest-configuration) -> result<_, error>;

/// A message can exist under several statuses:
/// (1) available: the message is ready to be read,
Expand All @@ -22,6 +22,6 @@ interface consumer {
/// - deleted,
/// - sent to a dead-letter queue, or
/// - kept in the queue for further processing.
complete-message: func(m: message) -> result<_, error>
abandon-message: func(m: message) -> result<_, error>
complete-message: func(m: message) -> result<_, error>;
abandon-message: func(m: message) -> result<_, error>;
}
6 changes: 3 additions & 3 deletions wit/guest.wit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface messaging-guest {
use messaging-types.{message, guest-configuration, error}
use messaging-types.{message, guest-configuration, error};

/// Returns the list of channels (and extension metadata within guest-configuration) that
/// this component should subscribe to and be handled by the subsequent handler within guest-configuration
configure: func() -> result<guest-configuration, error>
configure: func() -> result<guest-configuration, error>;

/// Whenever this guest receives a message in one of the subscribed channels, the message is sent to this handler
handler: func(ms: list<message>) -> result<_, error>
handler: func(ms: list<message>) -> result<_, error>;
}
8 changes: 4 additions & 4 deletions wit/messaging.wit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package wasi:messaging
package wasi:messaging;

world messaging {
import producer
import consumer
import producer;
import consumer;

export messaging-guest
export messaging-guest;
}
4 changes: 2 additions & 2 deletions wit/producer.wit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface producer {
use messaging-types.{client, channel, message, error}
use messaging-types.{client, channel, message, error};

send: func(c: client, ch: channel, m: list<message>) -> result<_, error>
send: func(c: client, ch: channel, m: list<message>) -> result<_, error>;
}
14 changes: 7 additions & 7 deletions wit/types.wit
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
interface messaging-types {
/// A connection to a message-exchange service (e.g., buffer, broker, etc.).
type client = u32
disconnect: func(c: client)
connect: func(name: string) -> result<client, error>
type client = u32;
disconnect: func(c: client);
connect: func(name: string) -> result<client, error>;

/// TODO(danbugs): This should be eventually extracted as an underlying type for other wasi-cloud-core interfaces.
type error = u32
drop-error: func(e: error)
trace: func(e: error) -> string
type error = u32;
drop-error: func(e: error);
trace: func(e: error) -> 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.
type channel = string
type channel = string;

/// 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.).
Expand Down

0 comments on commit 2560eb6

Please sign in to comment.