-
Notifications
You must be signed in to change notification settings - Fork 1
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
Introduce Steps #17
base: master
Are you sure you want to change the base?
Introduce Steps #17
Conversation
end | ||
|
||
def run_step(module, state) when is_atom(module) do | ||
apply(module, :run, [state, []]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All is okay here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, what is wrong?
A step can be one of the following:
* a 1-arity function
* a `{module, function, args}` tuple - calls `apply(module, function, [state | args])`
* a `{module, options}` tuple - calls `module.run(state, options)`
* a `module` atom - calls `module.run(state, [])`
lib/http_client/steps.ex
Outdated
] ++ | ||
maybe_steps(options[:auth], [{__MODULE__, :auth, [options[:auth]]}]) ++ | ||
maybe_steps(options[:params], [{__MODULE__, :put_params, [options[:params]]}]) ++ | ||
maybe_steps(options[:steps], [{__MODULE__, :run_steps, [options[:steps]]}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we can reverse this operation and use [x|y] syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed adding steps to request, can you look again?
lib/http_client/steps.ex
Outdated
response_telemetry_step = {__MODULE__, :log_response_end, []} | ||
|
||
retry = options[:retry] | ||
retry = if retry == true, do: [], else: retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can set retry: true
then it will be default case:
retry only in case of exceptions (HTTPoison.Error and Mint.Error e.g. are exceptions) or status code >= 500, for 3 times with 2 sec pause
0146390
to
02d00f9
Compare
6458b2d
to
be2cb9a
Compare
No description provided.