Skip to content

Commit

Permalink
Merge pull request #27 from golemcloud/golem-host-cleanup
Browse files Browse the repository at this point in the history
Clean up golem-host.wit
  • Loading branch information
vigoo authored Jul 26, 2024
2 parents 5beae37 + d198147 commit 88542aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
run: cargo test
- uses: cargo-bins/cargo-binstall@main
- name: Validate WIT
run: |
cargo binstall --no-confirm wasm-tools@1.0.57
run: |
cargo binstall --no-confirm wasm-tools@1.210.0
wasm-tools component wit -vv wit
publish:
needs: [build]
Expand Down
28 changes: 14 additions & 14 deletions wit/deps/golem/golem-host.wit
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface host {
/// The maximum delay between retries
max-delay: duration,
/// Multiplier applied to the delay on each retry to implement exponential backoff
multiplier: u32
multiplier: f64
}

/// Configurable persistence level for workers
Expand All @@ -58,7 +58,7 @@ interface host {

/// Describes how to update a worker to a different component version
enum update-mode {
/// Automatic update tries to recover the worker using the new component version
/// Automatic update tries to recover the worker using the new component version
/// and may fail if there is a divergence.
automatic,

Expand Down Expand Up @@ -159,18 +159,18 @@ interface host {
}

/// Create a new promise
golem-create-promise: func() -> promise-id;
create-promise: func() -> promise-id;

/// Suspends execution until the given promise gets completed, and returns the payload passed to
/// the promise completion.
golem-await-promise: func(promise-id: promise-id) -> list<u8>;
await-promise: func(promise-id: promise-id) -> list<u8>;

/// Completes the given promise with the given payload. Returns true if the promise was completed, false
/// if the promise was already completed. The payload is passed to the worker that is awaiting the promise.
golem-complete-promise: func(promise-id: promise-id, data: list<u8>) -> bool;
complete-promise: func(promise-id: promise-id, data: list<u8>) -> bool;

/// Deletes the given promise
golem-delete-promise: func(promise-id: promise-id) -> ();
delete-promise: func(promise-id: promise-id) -> ();

/// Returns a Golem worker URI that can be used to invoke a given function on the current worker
get-self-uri: func(function-name: string) -> uri;
Expand All @@ -182,13 +182,13 @@ interface host {
/// op log.
set-oplog-index: func(oplog-idx: oplog-index) -> ();

/// Blocks the execution until the oplog has been written to at least the specified number of replicas,
/// Blocks the execution until the oplog has been written to at least the specified number of replicas,
/// or the maximum number of replicas if the requested number is higher.
oplog-commit: func(replicas: u8) -> ();

/// Marks the beginning of an atomic operation.
/// In case of a failure within the region selected by `mark-begin-operation` and `mark-end-operation`
/// the whole region will be reexecuted on retry.
/// Marks the beginning of an atomic operation.
/// In case of a failure within the region selected by `mark-begin-operation` and `mark-end-operation`
/// the whole region will be reexecuted on retry.
/// The end of the region is when `mark-end-operation` is called with the returned oplog-index.
mark-begin-operation: func() -> oplog-index;

Expand All @@ -203,7 +203,7 @@ interface host {
/// new retry policy.
set-retry-policy: func(new-retry-policy: retry-policy) -> ();

/// Gets the worker's current persistence level.
/// Gets the worker's current persistence level.
get-oplog-persistence-level: func() -> persistence-level;

/// Sets the worker's current persistence level. This can increase the performance of execution in cases where durable
Expand All @@ -215,11 +215,11 @@ interface host {

/// Sets the current idempotence mode. The default is true.
/// True means side-effects are treated idempotent and Golem guarantees at-least-once semantics.
/// In case of false the executor provides at-most-once semantics, failing the worker in case it is
/// In case of false the executor provides at-most-once semantics, failing the worker in case it is
/// not known if the side effect was already executed.
set-idempotence-mode: func(idempotent: bool) -> ();

/// Generates an idempotency key. This operation will never be replayed —
/// Generates an idempotency key. This operation will never be replayed —
/// i.e. not only is this key generated, but it is persisted and committed, such that the key can be used in third-party systems (e.g. payment processing)
/// to introduce idempotence.
generate-idempotency-key: func() -> uuid;
Expand Down Expand Up @@ -254,4 +254,4 @@ world golem-host {
import host;
import save-snapshot;
import load-snapshot;
}
}

0 comments on commit 88542aa

Please sign in to comment.