Temporal Erlang and Elixir SDK samples

View Source

Hex Docs

This is the set of samples for the Temporal Erlang and Elixir SDK.

Each sample can be considered a standalone Elixir or Erlang application. A list of samples with instructions on how to start and use each sample is provided in the hexdocs documentation.

This software is published as a package on hex.pm to provide online hexdocs documentation exclusively. Please refrain from adding this package to your Elixir or Erlang application dependencies as it will have no effect. Please refer to the SDK repository for instructions on SDK usage.

Usage

Clone this repository, fetch dependencies using mix deps.get, and start iex -S mix or rebar3 shell. Run any of the available samples. Saga pattern implementation example run:

Elixir

iex(1)> Saga.start()
Compensation activity started with:
    %{"deposit" => "completed", "other" => "failed", "withdraw" => "canceled"}
...

Erlang

1> saga:start().
Compensation activity started with:
    #{<<"deposit">> => <<"completed">>,<<"other">> => <<"failed">>,
      <<"withdraw">> => <<"canceled">>}
...

Requirements

The basic configuration files provided with this repository assume an unsecured Temporal server running on localhost:7233. For development and testing purposes it is recommended to run the Temporal CLI locally:

  1. Install Temporal CLI.
  2. Start Temporal CLI dev server.