FallibleTransaction is a sequence of operations that are executed in a way that if any of the
operations fails all the already performed operation’s compensation actions got executed in
reverse order.
InfallibleTransaction is a sequence of operations that are executed in a way that if any of the
operations or the underlying Golem executor fails, the whole transaction is going to
be retried.
A unified interface for the different types of transactions. Using it can make the code
easier to switch between different transactional guarantees but is more constrained in
terms of error types.
Fallible transaction execution. If any operation fails, all the already executed
successful operation’s compensation actions are executed in reverse order and the transaction
returns with a failure.
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.
Retry the transaction in case of failure. If any operation returns with a failure, all
the already executed successful operation’s compensation actions are executed in reverse order
and the transaction gets retried, using Golem’s active retry policy.
Same as infallible_transaction, but with strong rollback guarantees. The compensation actions
are guaranteed to be always executed before the transaction gets retried, even if it
fails due to a panic or an external executor failure.
Constructs an Operation from two closures: one for executing the operation,
and one for rolling it back. The rollback operation always sees the input and
the output of the operation.
A generic interface for defining transactions, where the transaction mode is
determined by the function’s parameter (it can be FallibleTransaction or InfallibleTransaction).
Annotates a module with #[golem_rust_macro::create_wit_file] and generates WIT file in the root of your project.
Supports enums, structs, traits and alias types.
Derives From<> And Into<> typeclasses for wit-bindgen generated data types (e.g. WitPerson)
and custom domain data types (e.g. Person). So it’s possible to write code like this: