CharlesO
How do we limit a Req.post! or Req.get! to a total timeout of just 2000ms?
I have an integration that needs very timely responses.
Limiting external API requests to just 2000ms would help my integration scenario.
I have looked at the documentation, but I’m not getting it at all.
As usual, AI suggestions are no use either.
suggested code - Via WhatsApp Meta AI Llama 3.2
def test do
Req.get!("https://api.github.com/repos/wojtekmach/req",
finch: [
options: [
timeout: 2000,
receive_timeout: 2000
]
]
)
end
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
Practical Data Orchestration in Elixir - Silvia Zeamer | ElixirConf EU 2026
https://www.youtube.com/watch?v=bVb1xmf3S34
Comments welco...
New
I like to find performance optimizations and hidden bugs in Elixir codebases with coding agents.
If I just ask them directly to find tho...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
CharlesO
this seems to limit just the connection part, but not the entire request duration
Req.get!("https://httpbin.org", connect_options: [timeout: 2000])hilko
Could it work to just spawn a task that just times out after that amount of time?
CharlesO
If I Cannot get the Req to behave as I expect it to, then your idea is indeed solid.
Thanks.
axelson
I think the Finch option you want is
:request_timeout:And if you’re using HTTP/2 then that won’t work.
And the syntax to set the various timeouts looks like:
The main place to see those options is at: Req — req v0.6.2
But I’m pretty sure those various timeouts all stack so if you want to limit the total time I agree with @hilko that a
Taskis your best bet.CharlesO
I added
retry: falseas well, so far thereceive_timeout: 2000seems okay