Module host

Module host 

Source
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§

AccountId
Represents a Golem Cloud account
AgentAllFilter
Combines multiple filter conditions with an AND relationship for enumerating agents
AgentAnyFilter
Combines multiple groups of filter conditions with an OR relationship for enumerating agents
AgentConfigVarsFilter
Describes a filter condition on the agent’s configuration variables when enumerating agents
AgentCreatedAtFilter
Describes a filter condition on the agent’s creation time when enumerating agents
AgentEnvFilter
Describes a filter condition on the agent’s environment variables when enumerating agents
AgentMetadata
Metadata about an agent
AgentNameFilter
Describes a filter condition on agent IDs when enumerating agents
AgentStatusFilter
Describes a filter condition on the agent status when enumerating agents
AgentVersionFilter
Describes a filter condition on the component version when enumerating agents
GetAgents
Creates an agent enumeration
GetPromiseResult
ProjectId
Represents a Golem project
PromiseId
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.
RetryPolicy
Configures how the executor retries failures

Enums§

AgentPropertyFilter
Describes one filter condition for enumerating agents
AgentStatus
The current status of an agent
FilterComparator
Operators used in filtering enumerated agents
ForkResult
Indicates which agent the code is running on after fork
PersistenceLevel
Configurable persistence level for agents
RevertAgentTarget
Target parameter for the revert-agent operation
StringFilterComparator
Operators used on strings in filtering enumerated agents
UpdateMode
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 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_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
ComponentId
ComponentVersion
Represents a Golem component’s version
Duration
OplogIndex
An index into the persistent log storing all performed operations of an agent
Pollable
Uuid
ValueAndType