Expand description
The Golem host API provides low level access to Golem specific features such as promises and control over the durability and transactional guarantees the executor provides.
Structs§
- Account
Id - Represents a Golem Cloud account
- GetWorkers
- Project
Id - Represents a Golem project
- Promise
Id - A promise ID is a value that can be passed to an external Golem API to complete that promise from an arbitrary external source, while Golem workers can await for this completion.
- Retry
Policy - Configures how the executor retries failures
- Worker
AllFilter - Worker
AnyFilter - Worker
Created AtFilter - Worker
EnvFilter - Worker
Metadata - Worker
Name Filter - Worker
Status Filter - Worker
Version Filter - Worker
Wasi Config Vars Filter
Enums§
- Filter
Comparator - Fork
Result - Indicates which worker the code is running on after
fork
- Persistence
Level - Configurable persistence level for workers
- Revert
Worker Target - Target parameter for the
revert-worker
operation - String
Filter Comparator - Update
Mode - Describes how to update a worker to a different component version
- Worker
Property Filter - Worker
Status
Functions§
- await_
promise - Suspends execution until the given promise gets completed, and returns the payload passed to the promise completion.
- complete_
promise - 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.
- create_
promise - Create a new promise
- delete_
promise - Deletes the given promise
- fork
- Forks the current worker at the current execution point. The new worker gets the
new-name
worker name, and this worker continues running as well. The return value is going to be different in this worker and the forked worker. - fork_
worker - Fork a worker to another worker at a given oplog index
- generate_
idempotency_ key - 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.
- get_
idempotence_ mode - Gets the current idempotence mode. See
set-idempotence-mode
for details. - get_
oplog_ index - Returns the current position in the persistent op log
- get_
oplog_ persistence_ level - Gets the worker’s current persistence level.
- get_
retry_ policy - Gets the current retry policy associated with the worker
- get_
self_ metadata - Get current worker metadata
- get_
worker_ metadata - Get worker metadata
- mark_
begin_ operation - Marks the beginning of an atomic operation.
In case of a failure within the region selected by
mark-begin-operation
andmark-end-operation
the whole region will be reexecuted on retry. The end of the region is whenmark-end-operation
is called with the returned oplog-index. - mark_
end_ operation - Commits this atomic operation. After
mark-end-operation
is called for a given index, further calls with the same parameter will do nothing. - oplog_
commit - 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.
- poll_
promise - Checks whether the given promise is completed. If not, it returns None. If the promise is completed, it returns the payload passed to the promise completion.
- resolve_
component_ id - Get the component-id for a given component reference. Returns none when no component with the specified reference exists. The syntax of the component reference is implementation dependent.
- resolve_
worker_ id - Get the worker-id for a given component and worker name. Returns none when no component for the specified reference exists.
- resolve_
worker_ id_ strict - Get the worker-id for a given component and worker name. Returns none when no component for the specified component-reference or no worker with the specified worker-name exists.
- revert_
worker - Revert a worker to a previous state
- set_
idempotence_ mode - 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 not known if the side effect was already executed.
- set_
oplog_ index - Makes the current worker travel back in time and continue execution from the given position in the persistent op log.
- set_
oplog_ persistence_ level - Sets the worker’s current persistence level. This can increase the performance of execution in cases where durable execution is not required.
- set_
retry_ policy - Overrides the current retry policy associated with the worker. Following this call,
get-retry-policy
will return the new retry policy. - update_
worker - Initiates an update attempt for the given worker. The function returns immediately once the request has been processed, not waiting for the worker to get updated.
Type Aliases§
- Component
Id - Component
Version - Represents a Golem component’s version
- Duration
- Oplog
Index - An index into the persistent log storing all performed operations of a worker
- Uuid
- Value
AndType - Worker
Id