Igosuki / binance-rs-async

Async client for the Binance APIs
https://crates.io/crates/binance-rs-async
Other
184 stars 113 forks source link

Configure timeout of the client. #57

Closed VCasecnikovs closed 1 year ago

VCasecnikovs commented 1 year ago

Hi! For now I am not at my home and I tried to develop my app.

Unfortunately, I had magic "timed out" error.

I found 2 seconds timeout in Client initialisation.

It would be very cool if there would be an option to configure this in Config or somewhere else.

To have backwards compatibility we can not add one more parameter to Client struct, but we can create new "new_with_timeout" method.

Best regards, Vadims.

avgrocks commented 1 year ago

I've exactly the same issue, with this timeout. Looking at the Code a new method new_with_timeout would not help, api.rs has to be changed as well. In my opinion the better place is the config.rs. Then we can just use new_with_config which exists for anything.

VCasecnikovs commented 1 year ago

I've exactly the same issue, with this timeout. Looking at the Code a new method new_with_timeout would not help, api.rs has to be changed as well. In my opinion the better place is the config.rs. Then we can just use new_with_config which exists for anything.

Have you managed to solve the problem?

VCasecnikovs commented 1 year ago

Fixed it in PR #58

avgrocks commented 1 year ago

@Igosuki can we merge this?

Igosuki commented 1 year ago

I merged and fixed it, look out for the next version (1.2.2) soon