Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plug-style callback module as a step argument #18

Open
AndrewDryga opened this issue Apr 29, 2018 · 0 comments
Open

Support plug-style callback module as a step argument #18

AndrewDryga opened this issue Apr 29, 2018 · 0 comments

Comments

@AndrewDryga
Copy link
Member

AndrewDryga commented Apr 29, 2018

MFA's are rather ugly and I'm not sure why someone would use them, resulting code is harder to read. We might build a Sage.Operation behavior with two callbacks:

# required
@callback transaction(effects_so_far :: effects(), execute_opts :: any()) ::  {:ok | :error | :abort, any()}

# optional
@callback compensation(effect_to_compensate :: any(),
           effects_so_far :: effects(),
           execute_opts :: any()) :: :ok | :abort | {:retry, retry_opts :: retry_opts()} | {:continue, any()}

Introducing this change and removing MFA would help to make sure that saga can be type checked #17.

@AndrewDryga AndrewDryga changed the title Support plug-style callback module as a Sage argument Support plug-style callback module as a step argument Apr 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant