hackney icon indicating copy to clipboard operation
hackney copied to clipboard

Allow setting recv_timeout when sending request

Open felixyz opened this issue 1 year ago • 2 comments

I needed a longer timeout so added the ability to set it manually. Happy to refactor if would risk breaking anyone's code (if they are calling send_bits directly).

felixyz avatar Jan 19 '24 15:01 felixyz

Hello! Aye you're right, we'll need to adjust a bit to avoid breaking existing code.

It would be nice to also leave the door open for more configuration. Perhaps we could provide another API here using the builder pattern?

request
|> hackney.configure
|> hackney.receive_timeout_ms(5000)
|> hackney.dispatch_bits

lpil avatar Jan 20 '24 10:01 lpil

I guess I should at least have run the tests 😇

@lpil Yes builder is clearly the way to go. I'm on it.

felixyz avatar Jan 23 '24 10:01 felixyz