Skip to content

Conversation

@anronin
Copy link
Member

@anronin anronin commented Apr 24, 2022

No description provided.

@anronin anronin requested a review from Judis April 24, 2022 19:49
end

def run_step(module, state) when is_atom(module) do
apply(module, :run, [state, []])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All is okay here?

Copy link
Member Author

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, [])`

] ++
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]]}])
Copy link
Contributor

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?

Copy link
Member Author

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?

response_telemetry_step = {__MODULE__, :log_response_end, []}

retry = options[:retry]
retry = if retry == true, do: [], else: retry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify that?

Copy link
Member Author

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

@anronin anronin force-pushed the add-steps branch 3 times, most recently from 02d00f9 to 9e8acbd Compare June 6, 2022 16:58
@anronin anronin force-pushed the add-steps branch 2 times, most recently from faeaa15 to 319b858 Compare August 3, 2022 13:31
@anronin anronin force-pushed the add-steps branch 3 times, most recently from be2cb9a to a58cc3b Compare August 6, 2023 12:57
@anronin anronin force-pushed the add-steps branch 3 times, most recently from cbf95f1 to ad2f92d Compare April 23, 2025 11:54
@anronin anronin force-pushed the add-steps branch 5 times, most recently from 161faf1 to 577799a Compare January 14, 2026 10:45
* Add exponent retry
* Dynamically start Finch pool with the given proxy configs
* Support multiple content-encoding headers
* Add follow_redirects step
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

Successfully merging this pull request may close these issues.

3 participants