Skip to content

Instantly share code, notes, and snippets.

@AndrewDryga
Last active June 4, 2018 12:36
Show Gist options
  • Save AndrewDryga/67628c4c0fc4afa3af6e0841cc960b3e to your computer and use it in GitHub Desktop.
Save AndrewDryga/67628c4c0fc4afa3af6e0841cc960b3e to your computer and use it in GitHub Desktop.
Sage: Callbacks
@callback transaction(attrs :: map()) ::
{:ok, last_effect :: any(), all_effects :: map()} | {:error, reason :: any()}
@callback compensation(effect_to_compensate :: any(), effects_so_far :: map(), attrs :: any()) ::
:ok
| :abort
| {:retry,
[
{:retry_limit, pos_integer()},
{:base_backoff, pos_integer() | nil},
{:max_backoff, pos_integer()},
{:enable_jitter, boolean()}
]}
| {:continue, effect :: any()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment