Skip to content

Introduce Steps - #17

Open
anronin wants to merge 1 commit into
masterfrom
add-steps
Open

Introduce Steps#17
anronin wants to merge 1 commit into
masterfrom
add-steps

Conversation

@anronin

Copy link
Copy Markdown
Member

No description provided.

@anronin
anronin requested a review from JudisApril 24, 2022 19:49
Comment threadmix.exs
end

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

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

Comment threadlib/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]]}])

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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?

Comment threadlib/http_client/steps.ex Outdated
response_telemetry_step = {__MODULE__, :log_response_end, []}

retry = options[:retry]
retry = if retry == true, do: [], else: retry

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

Comment threadlib/http_client/steps.ex Outdated
Comment threadlib/http_client/steps.ex
Comment threadlib/http_client/steps.ex
@anronin
anroninforce-pushed the add-steps branch 3 times, most recently from 02d00f9 to 9e8acbdCompareJune 6, 2022 16:58
@anronin
anroninforce-pushed the add-steps branch 2 times, most recently from faeaa15 to 319b858CompareAugust 3, 2022 13:31
@anronin
anroninforce-pushed the add-steps branch 3 times, most recently from be2cb9a to a58cc3bCompareAugust 6, 2023 12:57
@anronin
anroninforce-pushed the add-steps branch 3 times, most recently from cbf95f1 to ad2f92dCompareApril 23, 2025 11:54
@anronin
anroninforce-pushed the add-steps branch 6 times, most recently from 577799a to 6f0bc74CompareJanuary 14, 2026 10:57
* Add exponent retry
* Dynamically start Finch pool with the given proxy configs
* Support multiple content-encoding headers
* Add follow_redirects step
Sign up for freeto 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.

2 participants

@anronin@Judis