Skip to content
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

Define request timeout for Client.fetch #128

Open
varadig opened this issue Jan 5, 2021 · 4 comments
Open

Define request timeout for Client.fetch #128

varadig opened this issue Jan 5, 2021 · 4 comments

Comments

@varadig
Copy link

varadig commented Jan 5, 2021

How can I set timeout (how many time wait for response) for Client.fetch method?

@varadig
Copy link
Author

varadig commented Jan 6, 2021

I need to drop the connection trying after 300ms.

@kevinresol
Copy link
Member

kevinresol commented Jan 6, 2021

There is no such API currently. You can instead use Future#first to manually create a timeout

Future.delay(300, Failure(new Error('Timed out'))).first(Client.fetch(...));

@varadig
Copy link
Author

varadig commented Jan 6, 2021

I mean now there is a long time (1-3 sec) while the connection be dropped. I need to iterate over ip addresses from 1-255 and test them to there is available connection. So the ideal would be just 300 (or under) millisec

@varadig
Copy link
Author

varadig commented Jan 6, 2021

@varadig varadig changed the title Define timeout for Client.fetch Define request timeout for Client.fetch Jan 6, 2021
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

No branches or pull requests

2 participants