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
- Agent
AllFilter - Combines multiple filter conditions with an
AND
relationship for enumerating agents - Agent
AnyFilter - Combines multiple groups of filter conditions with an
OR
relationship for enumerating agents - Agent
Config Vars Filter - Describes a filter condition on the agent’s configuration variables when enumerating agents
- Agent
Created AtFilter - Describes a filter condition on the agent’s creation time when enumerating agents
- Agent
EnvFilter - Describes a filter condition on the agent’s environment variables when enumerating agents
- Agent
Metadata - Metadata about an agent
- Agent
Name Filter - Describes a filter condition on agent IDs when enumerating agents
- Agent
Status Filter - Describes a filter condition on the agent status when enumerating agents
- Agent
Version Filter - Describes a filter condition on the component version when enumerating agents
- GetAgents
- Creates an agent enumeration
- GetPromise
Result - 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 agents can await for this completion.
- Retry
Policy - Configures how the executor retries failures
Enums§
- Agent
Property Filter - Describes one filter condition for enumerating agents
- Agent
Status - The current status of an agent
- Filter
Comparator - Operators used in filtering enumerated agents
- Fork
Result - Indicates which agent the code is running on after
fork
- Persistence
Level - Configurable persistence level for agents
- Revert
Agent Target - Target parameter for the
revert-agent
operation - String
Filter Comparator - Operators used on strings in filtering enumerated agents
- Update
Mode - Describes how to update an agent to a different component version
Functions§
- 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 agent that is awaiting the promise.
- create_
promise - Create a new promise
- fork
- Forks the current agent at the current execution point. The new agent gets the
new-name
agent ID, and this agent continues running as well. The return value is going to be different in this agent and the forked agent. - fork_
agent - Fork an agent to another agent 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_
agent_ metadata - Get agent metadata
- 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 agent’s current persistence level.
- get_
promise - Gets a handle to the result of the promise. Can only be called in the same agent that orignally created the promise.
- get_
retry_ policy - Gets the current retry policy associated with the agent
- get_
self_ metadata - Get the current agent’s 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.
- resolve_
agent_ id - Get the agent-id for a given component and agent name. Returns none when no component for the specified reference exists.
- resolve_
agent_ id_ strict - Get the agent-id for a given component and agent-name. Returns none when no component for the specified component-reference or no agent with the specified agent-name exists.
- 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.
- revert_
agent - Revert an agent 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 agent in case it is not known if the side effect was already executed.
- set_
oplog_ index - Makes the current agent travel back in time and continue execution from the given position in the persistent op log.
- set_
oplog_ persistence_ level - Sets the agent’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 agent. Following this call,
get-retry-policy
will return the new retry policy. - update_
agent - Initiates an update attempt for the given agent. The function returns immediately once the request has been processed, not waiting for the agent to get updated.
Type Aliases§
- AgentId
- Component
Id - Component
Version - Represents a Golem component’s version
- Duration
- Oplog
Index - An index into the persistent log storing all performed operations of an agent
- Pollable
- Uuid
- Value
AndType